wuheng 2 éve
szülő
commit
6624c8bc1d
1 módosított fájl, 7 hozzáadás és 6 törlés
  1. 7 6
      Jenkinsfile

+ 7 - 6
Jenkinsfile

@@ -1,17 +1,17 @@
 pipeline {
-    agent {
-        docker {
-            image 'node:16-alpine'  
-        }
-    }
+    agent any
     stages {
         stage('Build') {
+            agent {
+                docker {
+                    image 'node:16-alpine'  
+                }
+            }
             steps {
                 sh 'docker-compose stop'
                 sh 'docker-compose rm -sf'
                 sh 'npm install --registry https://registry.npm.taobao.org'
                 sh 'npm run build:prod'
-                sh '/usr/bin/docker build -t HitSheep:0.1 .'
             }
         }
         stage('Test') {
@@ -22,6 +22,7 @@ pipeline {
         stage('Deploy') {
             steps {
                 echo 'Deploying....'
+                sh 'docker build -t HitSheep:0.1 .'
                 sh 'docker-compose up -d'
             }
         }