From 90dea8fde96f8d8684c661f3d68ad3a44722d338 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 15 Jul 2024 10:32:11 +0200 Subject: [PATCH] ci(Jenkinsfile): refs #7643 Tag only master as latest --- Jenkinsfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 36d112c1..ef4c3583 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -72,11 +72,15 @@ pipeline { } sh 'docker-compose build --build-arg BUILD_ID=$BUILD_ID --parallel' - sh 'docker tag $IMAGE:$TAG $IMAGE:latest' - sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' sh 'docker push $IMAGE:$TAG' - sh 'docker push $IMAGE:latest' + + script { + if (env.BRANCH_NAME == 'master') { + sh 'docker tag $IMAGE:$TAG $IMAGE:latest' + sh 'docker push $IMAGE:latest' + } + } withKubeConfig([ serverUrl: "$KUBERNETES_API",