From c43bf1595c28361bfe087720c9196d07afbfd748 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Thu, 20 Jan 2022 15:21:26 +0000 Subject: [PATCH 1/7] added test and package jobs to worker pipeline --- worker/Jenkinsfile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 127aa83fb5..f228bd0e31 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -10,20 +10,25 @@ pipeline { stage('build') { steps { echo 'Compile' - dir['worker'] { + dir('worker') { sh 'mvn compile' } } } stage('test') { steps { - echo 'Test' + dir('worker') { + echo 'mvn clean test' + } } } stage('package') { + steps { - echo 'Package' - } + dir('worker') { + echo 'mvn package' + } + } } } post { From 962ca2e6ec4f4564375155a4276c0bdf607301b6 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Thu, 20 Jan 2022 15:32:33 +0000 Subject: [PATCH 2/7] suped the complete message --- worker/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index f228bd0e31..675083cb41 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -27,13 +27,13 @@ pipeline { steps { dir('worker') { echo 'mvn package' - } + } } } } post { always { - echo 'This pipeline is completed' + echo 'This pipeline is completed now' } } } From c3226d2f6b2573547abae24f1603292e4821a4ed Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Thu, 20 Jan 2022 15:40:09 +0000 Subject: [PATCH 3/7] run archival --- worker/Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 675083cb41..ec594f5ffa 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -26,13 +26,15 @@ pipeline { steps { dir('worker') { - echo 'mvn package' + echo 'mvn package -DskipTess' } } } + } post { always { + archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true echo 'This pipeline is completed now' } } From 5378f4b2355feb24de76380520ec258f94dbd47b Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Thu, 20 Jan 2022 15:46:39 +0000 Subject: [PATCH 4/7] 2 --- worker/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index ec594f5ffa..5ce48c41f4 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -26,7 +26,7 @@ pipeline { steps { dir('worker') { - echo 'mvn package -DskipTess' + echo 'mvn package -DskipTests' } } } From ad3073e9426eab8204f5626e65b7d28127318f5a Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Thu, 20 Jan 2022 15:58:46 +0000 Subject: [PATCH 5/7] fixed --- worker/Jenkinsfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 5ce48c41f4..571e8d6230 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -9,7 +9,6 @@ pipeline { stages { stage('build') { steps { - echo 'Compile' dir('worker') { sh 'mvn compile' } @@ -18,7 +17,7 @@ pipeline { stage('test') { steps { dir('worker') { - echo 'mvn clean test' + sh 'mvn clean test' } } } @@ -26,12 +25,12 @@ pipeline { steps { dir('worker') { - echo 'mvn package -DskipTests' + sh 'mvn package -DskipTests' } } } - } + post { always { archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true From 3de404c2e477f08233783d97e7d63a2aed07748a Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Thu, 20 Jan 2022 20:57:25 +0000 Subject: [PATCH 6/7] run packaging step only for master, run stagesion only when worker code chagnes --- worker/Jenkinsfile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 571e8d6230..830f193473 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -8,6 +8,9 @@ pipeline { stages { stage('build') { + when { + changeset '**/worker/**' + } steps { dir('worker') { sh 'mvn compile' @@ -15,6 +18,9 @@ pipeline { } } stage('test') { + when { + changeset '**/worker/**' + } steps { dir('worker') { sh 'mvn clean test' @@ -22,10 +28,14 @@ pipeline { } } stage('package') { - + when { + branch 'master' + changeset '**/worker/**' + } steps { dir('worker') { sh 'mvn package -DskipTests' + archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true } } } @@ -33,7 +43,6 @@ pipeline { post { always { - archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true echo 'This pipeline is completed now' } } From d3dede5023d5b270ebc6d68c50efb847e1fe9b28 Mon Sep 17 00:00:00 2001 From: "robert.siwicki@googlemail.com" Date: Sat, 22 Jan 2022 09:44:42 +0000 Subject: [PATCH 7/7] smileyface --- worker/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index 830f193473..6c28e7d766 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -43,7 +43,7 @@ pipeline { post { always { - echo 'This pipeline is completed now' + echo 'This pipeline is completed now :-)' } } }