ソースを参照

feat(jenkins): 更新配置

zengzhixiang 2 年 前
コミット
cf6ad588c3
共有1 個のファイルを変更した5 個の追加16 個の削除を含む
  1. 5 16
      Jenkinsfile

+ 5 - 16
Jenkinsfile

@@ -35,25 +35,14 @@ pipeline {
       }
     }
     stage('构建项目') {
-      when {
-        branch 'feature/jenkinsfile'
-      }
-      steps {
-        nodejs('v16'){
-          sh '''
-            npm run build:test
-          '''
-        }
-      }
-    }
-    stage('构建项目') {
-      when {
-        branch 'feature/jenkinsfile2'
-      }
       steps {
         nodejs('v16'){
           sh '''
-            npm run build:uat
+            if [ "$branch" == "feature/jenkinsfile" ]; then
+              npm run build:test
+            elif [ "$branch" == "feature/jenkinsfile2" ]; then
+              npm run build:uat
+            fi
           '''
         }
       }