Browse Source

更新 'Jenkinsfile'

sifu-gogs 2 năm trước cách đây
mục cha
commit
57dfca1b13
1 tập tin đã thay đổi với 7 bổ sung9 xóa
  1. 7 9
      Jenkinsfile

+ 7 - 9
Jenkinsfile

@@ -5,16 +5,14 @@ pipeline {
     }
     stages {
         stage('Build') {
-            agent {
-                docker {
-                    image 'node:16-alpine'
-                    args '-v /var/run/docker.sock:/var/run/docker.sock -v /usr/local/bin/docker-compose:/usr/local/bin/docker-compose'  
-                }
-            }
             steps {
-                sh 'docker-compose down'
-                sh 'npm install --registry https://registry.npm.taobao.org'
-                sh 'npm run build:prod'
+				sh 'docker-compose down'
+                nodejs('16.19.0') {
+                    sh 'npm install yarn -g --registry https://registry.npm.taobao.org'
+                    sh 'yarn config set registry https://registry.npm.taobao.org/'
+                    sh 'yarn install'
+                    sh 'yarn run build:prod'
+                }
                 sh 'docker build -t ${BRANCH_NAME}:${BUILD_NUMBER} .'
             }
         }