Ver código fonte

feat(jenkins): upd

zengzhixiang 2 anos atrás
pai
commit
a91f2f55f6
1 arquivos alterados com 9 adições e 5 exclusões
  1. 9 5
      Jenkinsfile

+ 9 - 5
Jenkinsfile

@@ -36,13 +36,17 @@ pipeline {
     }
     stage('构建项目') {
       steps {
-        nodejs('v16') {
-          script {
-            if ( '${BRANCH_NAME}' === 'master' ) {
+        script {
+          if ( '${BRANCH_NAME}' === 'master' ) {
+            nodejs('v16') {
               sh 'npm run build:prod'
-            } else if ( '${BRANCH_NAME}' === 'uat' ){
+            }
+          } else if ( '${BRANCH_NAME}' === 'uat' ){
+            nodejs('v16') {
               sh 'npm run build:uat'
-            } else {
+            }
+          } else {
+            nodejs('v16') {
               sh 'npm run build:test'
             }
           }