update deploy2prod jenkinsfile
This commit is contained in:
25
openshift/prod/Jenkinsfile
vendored
25
openshift/prod/Jenkinsfile
vendored
@@ -6,6 +6,12 @@ def prod_project = "${PROD_NAMESPACE}"
|
|||||||
def jenkinsslave = "nodejs15-agent"
|
def jenkinsslave = "nodejs15-agent"
|
||||||
def dist_path = "dist/apps/mina-sidor-fa"
|
def dist_path = "dist/apps/mina-sidor-fa"
|
||||||
|
|
||||||
|
def REGISTRY = 'nexus.arbetsformedlingen.se:5555'
|
||||||
|
def PROJECT_CONTAINING_IMAGES = "app-af-nexus"
|
||||||
|
def USE_CONFIG_MAP = false
|
||||||
|
def CONFIG_MAP_KEY = "${appname}-config"
|
||||||
|
def CONFIG_MAP_PATH = "./openshift/config-maps/${prod_project}.yaml"
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
|
|
||||||
agent {
|
agent {
|
||||||
@@ -163,10 +169,11 @@ pipeline {
|
|||||||
echo '### Trying to deploy to prod... ###'
|
echo '### Trying to deploy to prod... ###'
|
||||||
script {
|
script {
|
||||||
openshift.withCluster() {
|
openshift.withCluster() {
|
||||||
def api = "https://pocpconsole.arbetsformedlingen.se:443"
|
utilities.defineAuth()
|
||||||
env.API = sh(script:"set +x; echo ${api}", returnStdout: true).replaceAll(/https?/, 'insecure')
|
// def api = "https://ocpcluster-a.arbetsformedlingen.se:443"
|
||||||
def encodedToken = openshift.selector('secret/imagepromote-token').object().data.tokenbase64
|
// env.API = sh(script:"set +x; echo ${api}", returnStdout: true).replaceAll(/https?/, 'insecure')
|
||||||
env.TOKEN = sh(script:"set +x; echo ${encodedToken} | base64 --decode", returnStdout: true)
|
// def encodedToken = openshift.selector('secret/imagepromote-token').object().data.tokenbase64
|
||||||
|
// env.TOKEN = sh(script:"set +x; echo ${encodedToken} | base64 --decode", returnStdout: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
openshift.withCluster( env.API, env.TOKEN ) {
|
openshift.withCluster( env.API, env.TOKEN ) {
|
||||||
@@ -174,10 +181,12 @@ pipeline {
|
|||||||
// Wait for approval
|
// Wait for approval
|
||||||
timeout(time:1440, unit:'MINUTES') {
|
timeout(time:1440, unit:'MINUTES') {
|
||||||
input message: "Go Live with ${ appname } in Production?", ok: "Confirm"
|
input message: "Go Live with ${ appname } in Production?", ok: "Confirm"
|
||||||
openshift.raw("tag nexus.arbetsformedlingen.se:5555/app-af-nexus/${ appname }:${BUILD_TAG} ${appname}:${BUILD_TAG} --insecure")
|
def label = "${ env.BUILD_NUMBER }"
|
||||||
openshift.raw("tag ${ appname }:latest ${ appname }:${BUILD_TAG}")
|
utilities.rollout("${ appname }", "${ appname }", "latest", label, PROJECT_CONTAINING_IMAGES, REGISTRY, USE_CONFIG_MAP, "${ CONFIG_MAP_KEY }", CONFIG_MAP_PATH)
|
||||||
openshift.raw("set image dc/${ appname } ${ appname }=nexus.arbetsformedlingen.se:5555/app-af-nexus/${ appname }:${BUILD_TAG} --record=true --source=docker")
|
//openshift.raw("tag nexus.arbetsformedlingen.se:5555/app-af-nexus/${ appname }:${BUILD_TAG} ${appname}:${BUILD_TAG} --insecure")
|
||||||
openshift.selector("dc", "${ appname }").rollout().status();
|
//openshift.raw("tag ${ appname }:latest ${ appname }:${BUILD_TAG}")
|
||||||
|
//openshift.raw("set image dc/${ appname } ${ appname }=nexus.arbetsformedlingen.se:5555/app-af-nexus/${ appname }:${BUILD_TAG} --record=true --source=docker")
|
||||||
|
//openshift.selector("dc", "${ appname }").rollout().status();
|
||||||
echo '### Deployed to prod! ###'
|
echo '### Deployed to prod! ###'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user