wuheng 2 năm trước cách đây
mục cha
commit
e537d16d7d
1 tập tin đã thay đổi với 3 bổ sung6 xóa
  1. 3 6
      Jenkinsfile

+ 3 - 6
Jenkinsfile

@@ -7,15 +7,15 @@ pipeline {
         stage('Build') {
             agent {
                 docker {
-                    image 'node:16-alpine'  
+                    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 'pwd'
-                sh 'ls -la'
+                sh 'docker build -t ${BRANCH_NAME}:${BUILD_NUMBER} .'
             }
         }
         stage('Test') {
@@ -26,9 +26,6 @@ pipeline {
         stage('Deploy') {
             steps {
                 echo 'Deploying....'
-                sh 'pwd'
-                sh 'ls -la'
-                sh 'docker build -t ${BRANCH_NAME}:${BUILD_NUMBER} .'
                 sh 'docker-compose up -d'
             }
         }