Browse Source

Merge branch 'cy' of http://39.105.160.25:10880/post-project-ui/post-ui into cy

wuheng 2 năm trước cách đây
mục cha
commit
60cc56a3ef
1 tập tin đã thay đổi với 8 bổ sung15 xóa
  1. 8 15
      Jenkinsfile

+ 8 - 15
Jenkinsfile

@@ -5,22 +5,15 @@ pipeline {
     }
     stages {
         stage('Build') {
-            agent {
-                docker {
-                    image 'node:16-alpine'
-                    args '-v /usr/bin/docker:/usr/bin/dockerio -v /var/run/docker.sock:/var/run/docker.sock -v /usr/local/bin/docker-compose:/usr/local/bin/docker-compose'  
-                }
-            }
             steps {
-                checkout scm
-                /*docker.image('node:16-alpine') { c ->*/
-                /*    sh 'docker -v'*/
-                /* }*/
-                sh 'dockerio -v'
-                /* sh 'docker-compose down' */
-                /* sh 'npm install --registry https://registry.npm.taobao.org' */
-                /* sh 'npm run build:prod' */
-                /* sh 'docker build -t ${BRANCH_NAME}:${BUILD_NUMBER} .' */
+				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} .'
             }
         }
         stage('Test') {