Selaa lähdekoodia

Try this instead...

nossr50 2 päivää sitten
vanhempi
sitoutus
fc62946e27
1 muutettua tiedostoa jossa 5 lisäystä ja 3 poistoa
  1. 5 3
      Jenkinsfile

+ 5 - 3
Jenkinsfile

@@ -26,9 +26,11 @@ pipeline {
 		}
 
 		stage('Deploy to Nexus') {
-			when {
-				branch 'master'
-			}
+            when {
+                expression {
+                    return sh(script: 'git rev-parse --abbrev-ref HEAD', returnStdout: true).trim() == 'master'
+                }
+            }
 			steps {
 				withCredentials([usernamePassword(
 					credentialsId: 'nexus-deployer',