Benjamin Kornblum пре 8 месеци
родитељ
комит
85fc048ca7
1 измењених фајлова са 13 додато и 9 уклоњено
  1. 13 9
      Jenkinsfile

+ 13 - 9
Jenkinsfile

@@ -1,5 +1,4 @@
-pipeline {
-    agent any
+node {
     def app
 
     stage('Clone repository') {
@@ -11,16 +10,19 @@ pipeline {
     stage('Build image') {
         /* This builds the actual image; synonymous to
          * docker build on the command line */
+        agent {
 
-        app = docker.build("hochzeit:latest")
+            app = docker.build("hochzeit:latest")
+        }
     }
 
     stage('Test image') {
         /* Ideally, we would run a test framework against our image.
          * For this example, we're using a Volkswagen-type approach ;-) */
-
-        app.inside {
-            sh 'echo "Tests passed"'
+        agent {
+            app.inside {
+                sh 'echo "Tests passed"'
+            }
         }
     }
 
@@ -29,9 +31,11 @@ pipeline {
          * First, the incremental build number from Jenkins
          * Second, the 'latest' tag.
          * Pushing multiple tags is cheap, as all the layers are reused. */
-        docker.withRegistry('https://container.kornbum.dev', 'container-kornblum-dev') {
-            app.push("${env.BUILD_NUMBER}")
-            app.push("latest")
+        agent {
+            docker.withRegistry('https://container.kornbum.dev', 'container-kornblum-dev') {
+                app.push("${env.BUILD_NUMBER}")
+                app.push("latest")
+            }
         }
     }
 }