Last active
February 22, 2017 12:07
-
-
Save lu911/c011aac0e517b5ddeb28f8b6ef04b40c to your computer and use it in GitHub Desktop.
ddingdon-pipeline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node { | |
stage('Checkout') { | |
git branch: 'develop', url: 'GIT_URL', credentialsId: 'github' | |
gitCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim() | |
} | |
stage('Docker "base" image pull') { | |
docker.withRegistry('https://123456789.dkr.ecr.ap-northeast-1.amazonaws.com', 'ecr:ap-northeast-1:aws-ecr') { | |
docker.image('123456789.dkr.ecr.ap-northeast-1.amazonaws.com/base:latest').pull() | |
} | |
} | |
stage('Docker "api" image build') { | |
docker.build('api', '-f ./docker/api/Dockerfile .') | |
} | |
stage('Docker "api" image push') { | |
docker.withRegistry('https://123456789.dkr.ecr.ap-northeast-1.amazonaws.com', 'ecr:ap-northeast-1:aws-ecr') { | |
docker.image('api').push(gitCommit) | |
} | |
} | |
stage('Docker "admin" image build') { | |
docker.build('admin', '-f ./docker/admin/Dockerfile .') | |
} | |
stage('Docker "admin" image push') { | |
docker.withRegistry('https://123456789.dkr.ecr.ap-northeast-1.amazonaws.com', 'ecr:ap-northeast-1:aws-ecr') { | |
docker.image('admin').push(gitCommit) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment