ソースを参照

Try this instead...

nossr50 2 日 前
コミット
fc62946e27
1 ファイル変更5 行追加3 行削除
  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',