From d6893053c6cb007022bb3aefac4ca8f6d34f7571 Mon Sep 17 00:00:00 2001 From: AbhijitSaikia91 <79227334+AbhijitSaikia91@users.noreply.github.com> Date: Tue, 15 Jun 2021 14:03:38 +0530 Subject: [PATCH 1/5] Create JenkinsFile --- JenkinsFile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 JenkinsFile diff --git a/JenkinsFile b/JenkinsFile new file mode 100644 index 00000000..ba9c1091 --- /dev/null +++ b/JenkinsFile @@ -0,0 +1,34 @@ +pipeline { + agent any + + tools{ + maven 'Maven 3.6.3' + } + + stages{ + stage("build"){ + steps{ + echo 'compile sysfoo app' + sh 'mvn compile' + } + } + stage("test"){ + steps{ + echo 'running unit tests' + sh 'mvn clean test' + } + } + stage("package"){ + steps{ + echo 'packaging app to generate artifacts' + sh 'mvn package -DskipTests' + } + } + } + + post{ + always{ + echo 'This pipeline is completed..' + } + } +} From e32434618f253a77f3fe797a770f4fcd6ec7ed86 Mon Sep 17 00:00:00 2001 From: AbhijitSaikia91 <79227334+AbhijitSaikia91@users.noreply.github.com> Date: Tue, 15 Jun 2021 14:26:32 +0530 Subject: [PATCH 2/5] Create Jenkinsfile --- Jenkinsfile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..ba9c1091 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,34 @@ +pipeline { + agent any + + tools{ + maven 'Maven 3.6.3' + } + + stages{ + stage("build"){ + steps{ + echo 'compile sysfoo app' + sh 'mvn compile' + } + } + stage("test"){ + steps{ + echo 'running unit tests' + sh 'mvn clean test' + } + } + stage("package"){ + steps{ + echo 'packaging app to generate artifacts' + sh 'mvn package -DskipTests' + } + } + } + + post{ + always{ + echo 'This pipeline is completed..' + } + } +} From ef12f61a82566c81e2e2ba24f96f9136ac3daf59 Mon Sep 17 00:00:00 2001 From: AbhijitSaikia91 <79227334+AbhijitSaikia91@users.noreply.github.com> Date: Tue, 15 Jun 2021 14:47:17 +0530 Subject: [PATCH 3/5] added artifact archival step --- Jenkinsfile | 54 +++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ba9c1091..6ab555c1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,34 +1,36 @@ pipeline { agent any - - tools{ - maven 'Maven 3.6.3' - } - - stages{ - stage("build"){ - steps{ - echo 'compile sysfoo app' - sh 'mvn compile' - } + stages { + stage('build') { + steps { + echo 'compile sysfoo app' + sh 'mvn compile' } - stage("test"){ - steps{ - echo 'running unit tests' - sh 'mvn clean test' - } + } + + stage('test') { + steps { + echo 'running unit tests' + sh 'mvn clean test' } - stage("package"){ - steps{ - echo 'packaging app to generate artifacts' - sh 'mvn package -DskipTests' - } + } + + stage('package') { + steps { + echo 'packaging app to generate artifacts' + sh 'mvn package -DskipTests' + archiveArtifacts 'target/*.war' } - } + } - post{ - always{ - echo 'This pipeline is completed..' + } + tools { + maven 'Maven 3.6.3' + } + post { + always { + echo 'This pipeline is completed..' } + } -} +} \ No newline at end of file From d4c9b7a0f054b24b997713d460cdd0957ae4e296 Mon Sep 17 00:00:00 2001 From: AbhijitSaikia91 <79227334+AbhijitSaikia91@users.noreply.github.com> Date: Tue, 15 Jun 2021 14:49:05 +0530 Subject: [PATCH 4/5] nothing changed --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 6ab555c1..2ad619c2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,6 +20,7 @@ pipeline { echo 'packaging app to generate artifacts' sh 'mvn package -DskipTests' archiveArtifacts 'target/*.war' + archiveArtifacts 'target/*.war' } } From 76999ae7377cf079e79402805c5b52c4d95ec8c0 Mon Sep 17 00:00:00 2001 From: AbhijitSaikia91 <79227334+AbhijitSaikia91@users.noreply.github.com> Date: Wed, 16 Jun 2021 12:16:57 +0530 Subject: [PATCH 5/5] Added Jenkinsfile --- Jenkinsfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2ad619c2..89fd1b12 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,10 @@ pipeline { - agent any + agent { + docker { + image 'maven:3.6.3-jdk-11-slim' + } + + } stages { stage('build') { steps {