From d56c8ee3a96b6556ff864a80b60835e46a08aeb8 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 19 Jul 2024 13:15:59 +0200 Subject: [PATCH] fix: jenkins script --- Jenkinsfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 13dd7749d..718d67bca 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -188,9 +188,11 @@ pipeline { } sh 'docker login --username $CREDENTIALS_USR --password $CREDENTIALS_PSW $REGISTRY' sh 'docker-compose push' - if (env.BRANCH_NAME == 'master') { - sh 'docker tag $IMAGE:$TAG $IMAGE:latest' - sh 'docker push $IMAGE:latest' + script { + if (env.BRANCH_NAME == 'master') { + sh 'docker tag $IMAGE:$TAG $IMAGE:latest' + sh 'docker push $IMAGE:latest' + } } } }