Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
chore(build): publish images to both registries fromdoppler and doppl…
Browse files Browse the repository at this point in the history
…erdock
  • Loading branch information
andresmoschini committed Dec 28, 2020
1 parent 7f1a854 commit 59fb153
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,67 @@ pipeline {
}
}
}
stage('Publish in dopplerdock') {
environment {
DOCKER_CREDENTIALS_ID = "dockerhub_dopplerdock"
DOCKER_IMAGE_NAME = "dopplerdock/doppler-for-shopify"
}
stages {
stage('Publish pre-release images from pull request') {
when {
changeRequest target: 'master'
}
steps {
withDockerRegistry(credentialsId: "${DOCKER_CREDENTIALS_ID}", url: "") {
sh 'sh build-n-publish.sh --image=${DOCKER_IMAGE_NAME} --commit=${GIT_COMMIT} --name=pr-${CHANGE_ID}'
}
}
}
stage('Publish pre-release images from master') {
when {
branch 'master'
}
steps {
withDockerRegistry(credentialsId: "${DOCKER_CREDENTIALS_ID}", url: "") {
sh 'sh build-n-publish.sh --image=${DOCKER_IMAGE_NAME} --commit=${GIT_COMMIT} --name=master'
}
}
}
stage('Publish pre-release images from INT') {
when {
branch 'INT'
}
steps {
withDockerRegistry(credentialsId: "${DOCKER_CREDENTIALS_ID}", url: "") {
sh 'sh build-n-publish.sh --image=${DOCKER_IMAGE_NAME} --commit=${GIT_COMMIT} --name=INT'
}
}
}
stage('Publish pre-release images from PROD') {
// Temporal build for testing easily in production
when {
branch 'PROD'
}
steps {
withDockerRegistry(credentialsId: "${DOCKER_CREDENTIALS_ID}", url: "") {
sh 'sh build-n-publish.sh --image=${DOCKER_IMAGE_NAME} --commit=${GIT_COMMIT} --name=PROD'
}
}
}
stage('Publish final version images') {
when {
expression {
return isVersionTag(readCurrentTag())
}
}
steps {
withDockerRegistry(credentialsId: "${DOCKER_CREDENTIALS_ID}", url: "") {
sh 'sh build-n-publish.sh --image=${DOCKER_IMAGE_NAME} --commit=${GIT_COMMIT} --version=${TAG_NAME}'
}
}
}
}
}
}
}

Expand Down

0 comments on commit 59fb153

Please sign in to comment.