From 336d600cd1799a3ed249852d39b7f6fadde84093 Mon Sep 17 00:00:00 2001 From: username Date: Fri, 7 Feb 2025 14:17:15 +0000 Subject: [PATCH 1/2] a --- Jenkinsfile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..385a7ff3 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,33 @@ +pipeline { + agent any + tools{ + maven 'maven 3.9.8' + } + + stages{ + stage("build"){ + steps{ + echo 'Compiling worker app' + dir('worker'){ + sh 'mvn compile' + } + } + } + stage("test"){ + steps{ + echo 'Running Unit Tests on worker app' + } + } + stage("package"){ + steps{ + echo 'Packaging worker app' + } + } + } +post{ + always{ + echo 'Building multibranch pipeline for worker is completed..' + } + } +} + From 5d08ed337213a82eb3eb96d3097be64c0c90f281 Mon Sep 17 00:00:00 2001 From: username Date: Fri, 7 Feb 2025 15:05:52 +0000 Subject: [PATCH 2/2] added test and package jon --- Jenkinsfile | 33 --------------------- worker/Jenkinsfile | 73 +++++++++++++++++++++++----------------------- 2 files changed, 36 insertions(+), 70 deletions(-) delete mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 385a7ff3..00000000 --- a/Jenkinsfile +++ /dev/null @@ -1,33 +0,0 @@ -pipeline { - agent any - tools{ - maven 'maven 3.9.8' - } - - stages{ - stage("build"){ - steps{ - echo 'Compiling worker app' - dir('worker'){ - sh 'mvn compile' - } - } - } - stage("test"){ - steps{ - echo 'Running Unit Tests on worker app' - } - } - stage("package"){ - steps{ - echo 'Packaging worker app' - } - } - } -post{ - always{ - echo 'Building multibranch pipeline for worker is completed..' - } - } -} - diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile index b66016b2..2d8b99bf 100644 --- a/worker/Jenkinsfile +++ b/worker/Jenkinsfile @@ -1,41 +1,40 @@ -pipeline { - agent{ - docker{ - image 'maven:3.9.8-sapmachine-21' - args '-v $HOME/.m2:/root/.m2' - } - } - stages{ - stage('build'){ - steps{ - echo 'building worker app' - dir('worker'){ - sh 'mvn compile' - } - } - } - stage('test'){ - steps{ - echo 'running unit tests on worker app' - dir('worker'){ - sh 'mvn clean test' - } - } - } - stage('package'){ - steps{ - echo 'packaging worker app into a jarfile' - dir('worker'){ - sh 'mvn package -DskipTests' - archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true - } - } - } - } - post{ - always{ - echo 'the job is complete' +pipeline { + agent any + + tools{ + maven 'maven 3.9.8' + } + stages{ + stage("build"){ + steps{ + echo 'Compiling worker app' + dir('worker'){ + sh 'mvn compile' + } + } + } + stage("test"){ + steps{ + echo 'Running Unit Tests on worker app' + dir('worker') { + sh 'mvn clean test' + } + } + } + stage("package"){ + steps{ + echo 'Packaging worker app' + dir('worker'){ + sh 'mvn package' + } + } + } + } +post{ + always{ + echo 'Building multibranch pipeline for worker is completed..' } } } +