0355778d6e
- Rewrite as declarative - Add credentials - Gate images pushes to master branch only Signed-off-by: Dave Tucker <dt@docker.com>
54 lines
1.2 KiB
Groovy
54 lines
1.2 KiB
Groovy
pipeline {
|
|
agent {
|
|
node {
|
|
label 'ubuntu-1604-aufs-stable'
|
|
}
|
|
}
|
|
stages {
|
|
stage('Build result') {
|
|
steps {
|
|
sh 'docker build -t dockersamples/result ./result'
|
|
}
|
|
}
|
|
stage('Build vote') {
|
|
steps {
|
|
sh 'docker build -t dockersamples/vote ./vote'
|
|
}
|
|
}
|
|
stage('Build worker') {
|
|
steps {
|
|
sh 'docker build -t dockersamples/worker ./worker'
|
|
}
|
|
}
|
|
stage('Push result image') {
|
|
when {
|
|
branch 'master'
|
|
}
|
|
steps {
|
|
withDockerRegistry(credentialsId: 'dockerbuildbot-index.docker.io', url:'') {
|
|
sh 'docker push dockersamples/result'
|
|
}
|
|
}
|
|
}
|
|
stage('Push vote image') {
|
|
when {
|
|
branch 'master'
|
|
}
|
|
steps {
|
|
withDockerRegistry(credentialsId: 'dockerbuildbot-index.docker.io', url:'') {
|
|
sh 'docker push dockersamples/vote'
|
|
}
|
|
}
|
|
}
|
|
stage('Push worker image') {
|
|
when {
|
|
branch 'master'
|
|
}
|
|
steps {
|
|
withDockerRegistry(credentialsId: 'dockerbuildbot-index.docker.io', url:'') {
|
|
sh 'docker push dockersamples/worker'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |