diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-07-30 20:02:23 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-07-30 20:07:03 +0200 |
commit | de1d70636feb415e69c2dac5716195508f8a3477 (patch) | |
tree | 33eca16a43972480601e91bf29e34d45d92f16f3 /Jenkinsfile.docker | |
parent | 3d9411088411595f64de925d5499b50013e7a508 (diff) | |
download | vyos-build-de1d70636feb415e69c2dac5716195508f8a3477.tar.gz vyos-build-de1d70636feb415e69c2dac5716195508f8a3477.zip |
Jenkins: Docker: use dedicated variables for amd64/arm64
To not have potential overwritten variables, separate image names per
architecture.
Diffstat (limited to 'Jenkinsfile.docker')
-rw-r--r-- | Jenkinsfile.docker | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Jenkinsfile.docker b/Jenkinsfile.docker index 0706127..b241744 100644 --- a/Jenkinsfile.docker +++ b/Jenkinsfile.docker @@ -23,6 +23,9 @@ setDescription() pipeline { agent none + environment { + GIT_BRANCH_NAME = getGitBranchName() + } stages { stage('Build containers') { when { @@ -31,7 +34,7 @@ pipeline { // Only run ISO image build process of explicit user request or // once a night triggered by the timer. anyOf { - changeset pattern: "**/docker/*" + changeset pattern: "**/docker/*, **/Jenkinsfile.docker" triggeredBy cause: "UserIdCause" } } @@ -42,11 +45,11 @@ pipeline { } steps { script { - DOCKER_IMAGE = "vyos/vyos-build:" + getGitBranchName() - sh "docker build -t ${DOCKER_IMAGE} docker" + DOCKER_IMAGE_AMD64 = "vyos/vyos-build:" + env.GIT_BRANCH_NAME + sh "docker build -t ${DOCKER_IMAGE_AMD64} docker" if (! isCustomBuild()) { withDockerRegistry([credentialsId: "DockerHub"]) { - sh "docker push ${DOCKER_IMAGE}" + sh "docker push ${DOCKER_IMAGE_AMD64}" } } } @@ -58,11 +61,11 @@ pipeline { } steps { script { - DOCKER_IMAGE = "vyos/vyos-build:" + getGitBranchName() + "-arm64" - sh "docker build -t ${DOCKER_IMAGE} --build-arg ARCH=arm64v8/ docker" + DOCKER_IMAGE_ARM64 = "vyos/vyos-build:" + env.GIT_BRANCH_NAME + "-arm64" + sh "docker build -t ${DOCKER_IMAGE_ARM64} --build-arg ARCH=arm64v8/ docker" if (! isCustomBuild()) { withDockerRegistry([credentialsId: "DockerHub"]) { - sh "docker push ${DOCKER_IMAGE}" + sh "docker push ${DOCKER_IMAGE_ARM64}" } } } |