2

I'm trying to implement a CI&CD server using gitlab. my gitlab.ci config is something like this:

stages:  
  - deploy  
step-deploy-staging:
  stage: deploy       
  script:                
    - docker-compose up -d web

if I run my container with -d (detach) I can't understand the result of it because it will run on background. If i run docker-compose without detach mode, our gitlab pipeline never done

hossein derakhshan
  • 771
  • 2
  • 10
  • 23
  • So what exactly are you looking for? Btw you need use this https://stackoverflow.com/questions/52813302/exit-tail-upon-string-detection – Tarun Lalwani May 20 '20 at 11:14
  • @TarunLalwani imagine my docker-compose up file runs a web-server in specific port. I want to know if my containers ran correctly or it has some exit code – hossein derakhshan May 20 '20 at 11:19
  • Use this command for https://github.com/eficode/wait-for waiting for the app to be up. Once it is up, you can be at ease, if not you can execute the logs – Tarun Lalwani May 20 '20 at 11:28

0 Answers0