From df2232b621ee42828d980196209fecb15b02df1b Mon Sep 17 00:00:00 2001 From: Vipul Gupta Date: Wed, 20 Oct 2021 11:51:23 +0530 Subject: [PATCH 1/5] adding Jenkinsfile for sysfoo --- Jenkinsfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..e035ad40 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,30 @@ +pipeline{ + +agent any + +tools{ + maven 'Maven 3.6.3' +} + +stages{ + stage('build'){ + steps{ + echo 'compile maven app' + sh 'mvn compile' + } + } + stage('test'){ + steps{ + echo 'test maven app' + sh 'mvn clean test' + } + } + stage('package'){ + steps{ + echo 'package maven app' + sh 'mvn package -DskipTests' + } + } +} + +} \ No newline at end of file From 8595ff3093bfed36da5ff273cf12287e3913f560 Mon Sep 17 00:00:00 2001 From: vipulgupta11 <66633613+vipulgupta11@users.noreply.github.com> Date: Wed, 20 Oct 2021 12:05:03 +0530 Subject: [PATCH 2/5] Added Jenkinsfile --- Jenkinsfile | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e035ad40..d77d8981 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,30 +1,30 @@ -pipeline{ - -agent any - -tools{ - maven 'Maven 3.6.3' -} - -stages{ - stage('build'){ - steps{ - echo 'compile maven app' - sh 'mvn compile' - } +pipeline { + agent any + stages { + stage('build') { + steps { + echo 'compile maven app' + sh 'mvn compile' + } } - stage('test'){ - steps{ - echo 'test maven app' - sh 'mvn clean test' - } + + stage('test') { + steps { + echo 'test maven app' + sh 'mvn clean test' + } } - stage('package'){ - steps{ - echo 'package maven app' - sh 'mvn package -DskipTests' - } + + stage('package') { + steps { + echo 'package maven app' + sh 'mvn package -DskipTests' + archiveArtifacts 'target/*.war' + } } -} + } + tools { + maven 'Maven 3.6.3' + } } \ No newline at end of file From 53b3a228b0d852aebf7902f4408f700c788eb92c Mon Sep 17 00:00:00 2001 From: Vipul Gupta Date: Wed, 20 Oct 2021 14:41:33 +0530 Subject: [PATCH 3/5] Test --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 38a78cde..b84a8490 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ This is a Sample Maven App. + +Test From 2fc936a7617e7a5d150d4966d53e7c144042f90a Mon Sep 17 00:00:00 2001 From: vipulgupta11 <66633613+vipulgupta11@users.noreply.github.com> Date: Wed, 20 Oct 2021 16:22:46 +0530 Subject: [PATCH 4/5] Added Jenkinsfile --- Jenkinsfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d77d8981..985392f5 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 { From adb5e3d707e9d5ade2b09bd85b779b907a40111a Mon Sep 17 00:00:00 2001 From: vipulgupta11 <66633613+vipulgupta11@users.noreply.github.com> Date: Wed, 20 Oct 2021 17:14:15 +0530 Subject: [PATCH 5/5] Added Jenkinsfile