Update Jenkinsfile to use build tag instead of latest

This commit is contained in:
Erik Tiekstra
2021-11-17 13:36:58 +01:00
parent 54ac27efc0
commit 43ed187f27

View File

@@ -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)
}
}
}