From 7ff9e2e97d5b8b5f0a4bec170812da377e4ca04c Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 9 Jul 2024 12:04:23 +0200 Subject: [PATCH] ci: refs #7643 Reprepro includedeb improve --- Jenkinsfile | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 164648c4..a74e7fdc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -86,7 +86,7 @@ pipeline { } } } - stage('Container') { + stage('Deploy') { when { anyOf { branch 'master' @@ -99,32 +99,21 @@ pipeline { steps { script { def packageJson = readJSON file: 'package.json' - env.VERSION = "${packageJson.version}-build${env.BUILD_ID}" + env.VERSION = "${packageJson.version}" + env.TAG = "${packageJson.version}-build${env.BUILD_ID}" } + sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' sh 'docker-compose push' - } - } - stage('Deploy') { - when { - anyOf { - branch 'master' - branch 'test' - } - } - steps { - script { - def packageJson = readJSON file: 'package.json' - env.VERSION = "${packageJson.version}-build${env.BUILD_ID}" - } + withKubeConfig([ serverUrl: "$KUBERNETES_API", credentialsId: 'kubernetes', namespace: 'salix' ]) { - sh 'kubectl set image deployment/hedera-web-$BRANCH_NAME hedera-web-$BRANCH_NAME=$REGISTRY/hedera-web:$VERSION' - sh 'kubectl set image deployment/hedera-web-cron-$BRANCH_NAME hedera-web-cron-$BRANCH_NAME=$REGISTRY/hedera-web:$VERSION' + sh 'kubectl set image deployment/hedera-web-$BRANCH_NAME hedera-web-$BRANCH_NAME=$REGISTRY/hedera-web:$TAG' + sh 'kubectl set image deployment/hedera-web-cron-$BRANCH_NAME hedera-web-cron-$BRANCH_NAME=$REGISTRY/hedera-web:$TAG' } } }