From 1b815e930cb72dc54d3911a55a565b84f96d5d1e Mon Sep 17 00:00:00 2001 From: Olev Kartau Date: Thu, 19 May 2022 14:49:43 +0300 Subject: [PATCH] Jenkinsfile: do not push images if job was PR-triggered --- Jenkinsfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 80185b45..0ca8fcfa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -155,11 +155,12 @@ pipeline { } } } - } - post { - success { - withDockerRegistry([ credentialsId: "e16bd38a-76cb-4900-a5cb-7f6aa3aeb22d", url: "https://${REG}" ]) { - sh "make push" + stage('push images') { + when { not { changeRequest() } } + steps { + withDockerRegistry([ credentialsId: "e16bd38a-76cb-4900-a5cb-7f6aa3aeb22d", url: "https://${REG}" ]) { + sh "make push" + } } } }