From 43ed187f2762af9d9b0b5c3e0b1f03490869580b Mon Sep 17 00:00:00 2001 From: Erik Tiekstra Date: Wed, 17 Nov 2021 13:36:58 +0100 Subject: [PATCH 1/3] Update Jenkinsfile to use build tag instead of latest --- openshift/prod/Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openshift/prod/Jenkinsfile b/openshift/prod/Jenkinsfile index b3c1688..b8bccea 100644 --- a/openshift/prod/Jenkinsfile +++ b/openshift/prod/Jenkinsfile @@ -122,7 +122,7 @@ pipeline { openshift.withCluster() { openshift.withProject(utv_project) { openshift.selector("bc", "${ appname }").startBuild("--from-dir=${dist_path}", "--wait=true") - openshift.tag("${ appname }:latest", "${ appname }:${BUILD_TAG}") + openshift.tag("${ appname }:${BUILD_TAG}", "${ appname }:${BUILD_TAG}") } } } @@ -143,7 +143,7 @@ pipeline { openshift.withProject(cicdproject) { def registry = "nexus.arbetsformedlingen.se:5555" withCredentials([usernamePassword(credentialsId: "${openshift.project()}-nexus-secret", usernameVariable: "REG_USER", passwordVariable: "REG_PWD")]) { - sh "skopeo copy docker://docker-registry.default.svc:5000/${utv_project}/${appname}:latest docker://${registry}/app-af-nexus/${appname}:latest --src-creds jenkins:\$(oc whoami -t) --dest-creds \"$REG_USER:$REG_PWD\" --src-tls-verify=false --dest-tls-verify=false --format v2s2" + sh "skopeo copy docker://docker-registry.default.svc:5000/${utv_project}/${appname}:${BUILD_TAG} docker://${registry}/app-af-nexus/${appname}:${BUILD_TAG} --src-creds jenkins:\$(oc whoami -t) --dest-creds \"$REG_USER:$REG_PWD\" --src-tls-verify=false --dest-tls-verify=false --format v2s2" } } } @@ -166,7 +166,7 @@ pipeline { timeout(time:24, unit:'HOURS') { // changed from 1440 input message: "Go Live with ${ appname } in Production?", ok: "Confirm" def label = "${BUILD_TAG}" - utilities.rollout("${ appname }", "${ appname }", "latest", label, PROJECT_CONTAINING_IMAGES, REGISTRY, USE_CONFIG_MAP, "${ CONFIG_MAP_KEY }", CONFIG_MAP_PATH) + utilities.rollout("${ appname }", "${ appname }", "${BUILD_TAG}", label, PROJECT_CONTAINING_IMAGES, REGISTRY, USE_CONFIG_MAP, "${ CONFIG_MAP_KEY }", CONFIG_MAP_PATH) } } } From 131bb7b36066ccafb02bd9617b41831117edadfd Mon Sep 17 00:00:00 2001 From: Erik Tiekstra Date: Wed, 17 Nov 2021 13:39:08 +0100 Subject: [PATCH 2/3] Updated Jenkinsfiles to use build tag instead of latest --- openshift/acc/Jenkinsfile | 2 +- openshift/next/Jenkinsfile | 2 +- openshift/playground/Jenkinsfile | 2 +- openshift/sys/Jenkinsfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openshift/acc/Jenkinsfile b/openshift/acc/Jenkinsfile index 3b0f720..4a27fa8 100644 --- a/openshift/acc/Jenkinsfile +++ b/openshift/acc/Jenkinsfile @@ -113,7 +113,7 @@ pipeline { openshift.withCluster() { openshift.withProject(utv_project) { openshift.selector("bc", "${ appname }").startBuild("--from-dir=${dist_path}", "--wait=true") - openshift.tag("${ appname }:latest", "${ appname }:${BUILD_TAG}") + openshift.tag("${ appname }:${BUILD_TAG}", "${ appname }:${BUILD_TAG}") } } } diff --git a/openshift/next/Jenkinsfile b/openshift/next/Jenkinsfile index 31d0352..d054f96 100644 --- a/openshift/next/Jenkinsfile +++ b/openshift/next/Jenkinsfile @@ -109,7 +109,7 @@ pipeline { openshift.withCluster() { openshift.withProject(utv_project) { openshift.selector("bc", "${ appname }").startBuild("--from-dir=${dist_path}", "--wait=true") - openshift.tag("${ appname }:latest", "${ appname }:${BUILD_TAG}") + openshift.tag("${ appname }:${BUILD_TAG}", "${ appname }:${BUILD_TAG}") } } } diff --git a/openshift/playground/Jenkinsfile b/openshift/playground/Jenkinsfile index 8c2b23d..f63db3f 100644 --- a/openshift/playground/Jenkinsfile +++ b/openshift/playground/Jenkinsfile @@ -109,7 +109,7 @@ pipeline { openshift.withCluster() { openshift.withProject(utv_project) { openshift.selector("bc", "${ appname }").startBuild("--from-dir=${dist_path}", "--wait=true") - openshift.tag("${ appname }:latest", "${ appname }:${BUILD_TAG}") + openshift.tag("${ appname }:${BUILD_TAG}", "${ appname }:${BUILD_TAG}") } } } diff --git a/openshift/sys/Jenkinsfile b/openshift/sys/Jenkinsfile index 90c6ec1..5355653 100644 --- a/openshift/sys/Jenkinsfile +++ b/openshift/sys/Jenkinsfile @@ -111,7 +111,7 @@ pipeline { openshift.withCluster() { openshift.withProject(utv_project) { openshift.selector("bc", "${ appname }").startBuild("--from-dir=${dist_path}", "--wait=true") - openshift.tag("${ appname }:latest", "${ appname }:${BUILD_TAG}") + openshift.tag("${ appname }:${BUILD_TAG}", "${ appname }:${BUILD_TAG}") } } } From f7171e818a06ab43cc753c8c45acb95e7fce27b9 Mon Sep 17 00:00:00 2001 From: Erik Tiekstra Date: Wed, 17 Nov 2021 14:09:43 +0100 Subject: [PATCH 3/3] Updated Jenkinsfiles --- openshift/acc/Jenkinsfile | 2 +- openshift/next/Jenkinsfile | 2 +- openshift/playground/Jenkinsfile | 2 +- openshift/prod/Jenkinsfile | 2 +- openshift/sys/Jenkinsfile | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openshift/acc/Jenkinsfile b/openshift/acc/Jenkinsfile index 4a27fa8..3b0f720 100644 --- a/openshift/acc/Jenkinsfile +++ b/openshift/acc/Jenkinsfile @@ -113,7 +113,7 @@ pipeline { openshift.withCluster() { openshift.withProject(utv_project) { openshift.selector("bc", "${ appname }").startBuild("--from-dir=${dist_path}", "--wait=true") - openshift.tag("${ appname }:${BUILD_TAG}", "${ appname }:${BUILD_TAG}") + openshift.tag("${ appname }:latest", "${ appname }:${BUILD_TAG}") } } } diff --git a/openshift/next/Jenkinsfile b/openshift/next/Jenkinsfile index d054f96..31d0352 100644 --- a/openshift/next/Jenkinsfile +++ b/openshift/next/Jenkinsfile @@ -109,7 +109,7 @@ pipeline { openshift.withCluster() { openshift.withProject(utv_project) { openshift.selector("bc", "${ appname }").startBuild("--from-dir=${dist_path}", "--wait=true") - openshift.tag("${ appname }:${BUILD_TAG}", "${ appname }:${BUILD_TAG}") + openshift.tag("${ appname }:latest", "${ appname }:${BUILD_TAG}") } } } diff --git a/openshift/playground/Jenkinsfile b/openshift/playground/Jenkinsfile index f63db3f..8c2b23d 100644 --- a/openshift/playground/Jenkinsfile +++ b/openshift/playground/Jenkinsfile @@ -109,7 +109,7 @@ pipeline { openshift.withCluster() { openshift.withProject(utv_project) { openshift.selector("bc", "${ appname }").startBuild("--from-dir=${dist_path}", "--wait=true") - openshift.tag("${ appname }:${BUILD_TAG}", "${ appname }:${BUILD_TAG}") + openshift.tag("${ appname }:latest", "${ appname }:${BUILD_TAG}") } } } diff --git a/openshift/prod/Jenkinsfile b/openshift/prod/Jenkinsfile index b8bccea..cde1012 100644 --- a/openshift/prod/Jenkinsfile +++ b/openshift/prod/Jenkinsfile @@ -122,7 +122,7 @@ pipeline { openshift.withCluster() { openshift.withProject(utv_project) { openshift.selector("bc", "${ appname }").startBuild("--from-dir=${dist_path}", "--wait=true") - openshift.tag("${ appname }:${BUILD_TAG}", "${ appname }:${BUILD_TAG}") + openshift.tag("${ appname }:latest", "${ appname }:${BUILD_TAG}") } } } diff --git a/openshift/sys/Jenkinsfile b/openshift/sys/Jenkinsfile index 5355653..90c6ec1 100644 --- a/openshift/sys/Jenkinsfile +++ b/openshift/sys/Jenkinsfile @@ -111,7 +111,7 @@ pipeline { openshift.withCluster() { openshift.withProject(utv_project) { openshift.selector("bc", "${ appname }").startBuild("--from-dir=${dist_path}", "--wait=true") - openshift.tag("${ appname }:${BUILD_TAG}", "${ appname }:${BUILD_TAG}") + openshift.tag("${ appname }:latest", "${ appname }:${BUILD_TAG}") } } }