From 07241f1fc3febbdddf125b614e3442d43a502111 Mon Sep 17 00:00:00 2001 From: Jeel Alpeshkumar Bhavsar Date: Wed, 20 Oct 2021 11:59:18 +0530 Subject: [PATCH 1/6] add Jenkinsfile --- Jenkinsfile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..07df5e5a --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,37 @@ +pipeline { + agent any + + triggers { pollSCM('H/2 * * * *') } + + tools { + maven 'Maven 3.6.1' + } + + 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' + + } + } + } + + post{ + always{ + echo 'This pipeline is completed..' + } + } +} \ No newline at end of file From 810e04ad8aa3812dba90659e2babbdf47a1f012e Mon Sep 17 00:00:00 2001 From: sayZeeel Date: Wed, 20 Oct 2021 12:27:57 +0530 Subject: [PATCH 2/6] update maven --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 07df5e5a..f69ed210 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ pipeline { triggers { pollSCM('H/2 * * * *') } tools { - maven 'Maven 3.6.1' + maven 'Maven 3.6.3' } stages{ From df42525f51364a662ffce7596fbad23a2029c6bf Mon Sep 17 00:00:00 2001 From: sayZeeel Date: Wed, 20 Oct 2021 12:47:09 +0530 Subject: [PATCH 3/6] remove trigger --- Jenkinsfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f69ed210..63f48e2d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,5 @@ pipeline { agent any - - triggers { pollSCM('H/2 * * * *') } tools { maven 'Maven 3.6.3' From b9a29255406922cf39450061c67430eecda3871d Mon Sep 17 00:00:00 2001 From: Jeel Bhavsar Date: Wed, 20 Oct 2021 12:53:18 +0530 Subject: [PATCH 4/6] add archive artifacts step --- Jenkinsfile | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 63f48e2d..10c41696 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,35 +1,36 @@ pipeline { agent any - - tools { - maven 'Maven 3.6.3' - } - - stages{ - stage("Build"){ - steps{ - echo 'compile maven app' - sh 'mvn compile' - } + 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' } - } + } - 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 3a168cbde72cf2ada7564212ddca0c6463b2ce4c Mon Sep 17 00:00:00 2001 From: sayZeeel Date: Wed, 20 Oct 2021 14:34:40 +0530 Subject: [PATCH 5/6] added a claim --- test.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 test.md diff --git a/test.md b/test.md new file mode 100644 index 00000000..471c3066 --- /dev/null +++ b/test.md @@ -0,0 +1,4 @@ +Example App +================ + +Change my mind: Harry Potter and the Methods of Rationality by Eliezer Yudkowsky (Pen name Less Wrong) is the best fan fiction in the Potter Universe. From 4b77988d075a7af9cf55a8356e8de6f5b0a89092 Mon Sep 17 00:00:00 2001 From: Jeel Bhavsar Date: Wed, 20 Oct 2021 16:23:39 +0530 Subject: [PATCH 6/6] Added Jenkinsfile --- Jenkinsfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 10c41696..d009fc6a 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 {