Skip to content

Instantly share code, notes, and snippets.

@lu911
Last active February 22, 2017 12:07
Show Gist options
  • Save lu911/c011aac0e517b5ddeb28f8b6ef04b40c to your computer and use it in GitHub Desktop.
Save lu911/c011aac0e517b5ddeb28f8b6ef04b40c to your computer and use it in GitHub Desktop.
ddingdon-pipeline
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