From 138881a5768c8a0cba0cf2637c929eeed1b4ad53 Mon Sep 17 00:00:00 2001 From: Krishna Vemu Date: Sat, 20 May 2023 15:31:23 +0530 Subject: [PATCH 1/2] Added JenkinsFile --- Jenkinsfile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..6642b810 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,39 @@ +pipeline{ + + agent any + +// uncomment the following lines by removing /* and */ to enable + tools{ + maven 'Maven 3.9.2' + } + + + stages{ + stage('build'){ + steps{ + echo 'this is the build job' + sh 'mvn compile' + } + } + stage('Test'){ + steps{ + echo 'this is the test job' + sh 'mvn clean test' + } + } + stage('Package'){ + steps{ + echo 'this is the package job' + sh 'mvn package -DskipTests' + } + } + } + + post{ + always{ + echo 'this pipeline has completed...' + } + + } + +} From 555b5beef9745284568b8ecf58467c5a01f42ad6 Mon Sep 17 00:00:00 2001 From: vemukrishna <33975974+vemukrishna@users.noreply.github.com> Date: Sat, 20 May 2023 16:29:43 +0530 Subject: [PATCH 2/2] Archive --- Jenkinsfile | 68 +++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6642b810..918a1fe6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,39 +1,41 @@ -pipeline{ +pipeline { + agent any + stages { + stage('build') { + steps { + echo 'this is the build job' + sh 'mvn compile' + } + } - agent any + stage('Test') { + steps { + echo 'this is the test job' + sh 'mvn clean test' + } + } -// uncomment the following lines by removing /* and */ to enable - tools{ - maven 'Maven 3.9.2' + stage('Package') { + steps { + echo 'this is the package job' + sh 'mvn package -DskipTests' + } } - - stages{ - stage('build'){ - steps{ - echo 'this is the build job' - sh 'mvn compile' - } - } - stage('Test'){ - steps{ - echo 'this is the test job' - sh 'mvn clean test' - } - } - stage('Package'){ - steps{ - echo 'this is the package job' - sh 'mvn package -DskipTests' - } - } + stage('Archive') { + steps { + archiveArtifacts '**/target/*.jar' + } } - - post{ - always{ - echo 'this pipeline has completed...' - } - + + } + tools { + maven 'Maven 3.9.2' + } + post { + always { + echo 'this pipeline has completed...' } - -} + + } +} \ No newline at end of file