From a613315504275965293c1de408831905d98d8b70 Mon Sep 17 00:00:00 2001 From: imran1108 Date: Wed, 20 Oct 2021 10:08:49 +0530 Subject: [PATCH 1/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 38a78cde..6cbc838e 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -This is a Sample Maven App. +This is a Sample Maven App From 26512e7f46581f34d84667f452e5206eeb9cc932 Mon Sep 17 00:00:00 2001 From: imran1108 Date: Wed, 20 Oct 2021 11:58:15 +0530 Subject: [PATCH 2/5] Create jenkinsfile --- jenkinsfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 jenkinsfile diff --git a/jenkinsfile b/jenkinsfile new file mode 100644 index 00000000..491866c3 --- /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' +} +} +} + +} From b664aaee114cb2938ff64165242ed6dd6c0e3ae6 Mon Sep 17 00:00:00 2001 From: imran1108 Date: Wed, 20 Oct 2021 13:28:32 +0530 Subject: [PATCH 3/5] Create Jenkinsfile --- Jenkinsfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..491866c3 --- /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' +} +} +} + +} From b34f83aca0d5219a65157a532779e8c179075e6a Mon Sep 17 00:00:00 2001 From: imran1108 Date: Wed, 20 Oct 2021 13:31:18 +0530 Subject: [PATCH 4/5] Added Jenkinsfile --- Jenkinsfile | 54 ++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 491866c3..d77d8981 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,30 +1,30 @@ -pipeline{ +pipeline { + agent any + stages { + stage('build') { + steps { + echo 'compile maven app' + sh 'mvn compile' + } + } -agent any + stage('test') { + steps { + echo 'test maven app' + sh 'mvn clean test' + } + } -tools{ -maven 'Maven 3.6.3' -} + stage('package') { + steps { + echo 'package maven app' + sh 'mvn package -DskipTests' + archiveArtifacts 'target/*.war' + } + } -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' -} -} -} - -} + } + tools { + maven 'Maven 3.6.3' + } +} \ No newline at end of file From 264fd8d0b15fdd3adfcc796d4c5446f8151cb2b8 Mon Sep 17 00:00:00 2001 From: imran1108 Date: Wed, 20 Oct 2021 16:23:48 +0530 Subject: [PATCH 5/5] docker agent pipeline --- 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 {