-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jenkinsfile: avoid container collisions (unique tags) #1112
Conversation
I don't have much experience with Jenkins, but this might cause parallel jobs running on the same machine to interfere with one another.
Not sure if this is a real problem or not. If it is, we can consider tagging the docs container as
|
@joaofnfernandes oh... I don't have much experience with Jenkins either. I thought each build was made in its own clean environment. I work too much with Docker... 😋 |
@aduermael +1 giving each one a PR/build-specific container name would probably both fix the current issue we're having and also make cleanup easier if container delete fails afterwards somehow. :) |
66b401f
to
e947cab
Compare
@sanscontext ok, I'll see what I can do! |
Looks good to me! |
Signed-off-by: Adrien Duermael <adrien@duermael.com>
fd9c884
to
01562d5
Compare
LGTM, but like @joaofnfernandes I don't have a lot of experience with Jenkins. Should we call @mikedougherty for a look? |
@sanscontext I ended up using environment variables that are available in the build context, nothing fancy. Just waiting for tests to pass, then it can be merged. |
🙄
|
Is all of Docker using one API key? Might be at the point where we need to break it up. :/ |
Oh! All checks have passed! |
Proposed changes
Added one command in the Jenkinsfile to remove all Docker containers that might be present before running the tests. (because we've had issues where the container name was already taken)
sh "docker rm -fv $(docker ps -a -q)"
Now tagging images and containers with JOB_BASE_NAME and BUILD_NUMBER to avoid collisions.
cc @joaofnfernandes