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",