1

We had a Jenkins build system, using the Groovy DSL, that worked well for us.

But then we recently hired a new developer who is supposed to be very good. He decided to rewrite the way our tests work. We are now trying to make our build process adjust to his new ideas. We have a Python app. Previously, our build system went something like this:

git pull

run tests

if good, then push to ECR

Simple.

But he pulled all the tests into a separate container. So now I need to do something like:

  1. 'docker build' the main app

  2. 'docker run' the main app

  3. 'docker build' the test app

  4. 'docker run' the test app (this fires HTTP requests at the main app)

  5. get results from test app

  6. shut down main app

  7. if test results good, push to ECR

But when I call 'docker run' on the main app, it just runs forever. It's a Python web app, Django, with Gunicorn serving the web requests.

So, what do I do here? Should I spin the main app up in a separate thread, perhaps with a time to automatically kill it after a certain amount of time?

JeffGallant
  • 113
  • 1
  • 4

1 Answers1

0

Are you running docker run -d ... with the -d parameter to detach from the container? Could that be the problem?

Edit

I think you'll find you have to run docker run -d to detach from the container, otherwise it will just stay on the first container showing STDOUT until Jenkins kills the container when it stops the job. I'd just run them and give them a name, and then at the end of the Jenkins job, stop and remove all containers with that name.

Ex:

docker run -d --name jenkins-main-app main-app 
docker run -d --name jenkins-test-app test-app 

Then at the end:

docker stop --name jenkins-main-app
docker stop --name jenkins-test-app
docker rm --name jenkins-main-app
docker rm --name jenkins-test-app

Hope that helps.

David Birks
  • 366
  • 1
  • 5