Skip to content
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

Merged
merged 1 commit into from
Jan 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ wrappedNode(label: 'linux && x86_64') {
are not generated when building with Jekyll. */
sh "awk '/jekyll-redirect-from/{n=1}; n {n--; next}; 1' < _config.yml > _config.yml.tmp"
sh "mv _config.yml.tmp _config.yml"
sh "docker build -t docs `pwd`"
sh "docker build -t tests `pwd`/tests"
sh "docker run -v /usr/src/app/allvbuild --name docs docs /bin/true"
sh "docker run --rm --volumes-from docs -v `pwd`:/docs tests"
sh "docker rm -fv docs"
sh "docker rmi docs tests"

sh "docker build -t docs:${JOB_BASE_NAME}-${BUILD_NUMBER} `pwd`"
sh "docker build -t tests:${JOB_BASE_NAME}-${BUILD_NUMBER} `pwd`/tests"
sh "docker run -v /usr/src/app/allvbuild --name docs-${JOB_BASE_NAME}-${BUILD_NUMBER} docs:${JOB_BASE_NAME}-${BUILD_NUMBER} /bin/true"
sh "docker run --rm --volumes-from docs-${JOB_BASE_NAME}-${BUILD_NUMBER} -v `pwd`:/docs tests:${JOB_BASE_NAME}-${BUILD_NUMBER}"
sh "docker rm -fv docs-${JOB_BASE_NAME}-${BUILD_NUMBER}"
sh "docker rmi docs:${JOB_BASE_NAME}-${BUILD_NUMBER} tests:${JOB_BASE_NAME}-${BUILD_NUMBER}"
}