Browse Source

feat(jenkins): 区分分支

zengzhixiang 2 years ago
parent
commit
25c64544a0
1 changed files with 16 additions and 2 deletions
  1. 16 2
      Jenkinsfile

+ 16 - 2
Jenkinsfile

@@ -30,7 +30,7 @@ pipeline {
                 node -v
                 npm -v
                 npm install
-            '''
+          '''
         }
       }
     }
@@ -40,7 +40,21 @@ pipeline {
       }
       steps {
         nodejs('v16'){
-          sh 'npm run build:test'
+          sh '''
+            npm run build:test
+          '''
+        }
+      }
+    }
+    stage('构建项目') {
+      when {
+        branch 'feature/jenkinsfile2'
+      }
+      steps {
+        nodejs('v16'){
+          sh '''
+            npm run build:uat
+          '''
         }
       }
     }