From fd0afec4ea569fed96f059813e95e4fd8d5d926b Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Sat, 28 Sep 2019 20:16:44 +0530 Subject: [PATCH 01/22] Create JenkinsFile --- JenkinsFile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 JenkinsFile diff --git a/JenkinsFile b/JenkinsFile new file mode 100644 index 0000000..7f466d9 --- /dev/null +++ b/JenkinsFile @@ -0,0 +1,16 @@ +node{ + stage('SCM Git Checkout'){ + git 'https://github.com/sohitsrivastava/scribe-java-webapp.git' + } + stage('Compile Package'){ + def mvnHome = tool name: 'Maven', type: 'maven' + sh "${mvnHome}/bin/mvn package" + } + stage('Copy War File to Repo'){ + sh 'cp target/*.war /home/sohit/warfiles' + } + stage('Deploy to AWS'){ + sh 'cd /home/sohit' + sh './configureAWS.sh' + } +} From f98a86b4a451eac801d9dacf2dd4ad5064066019 Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Thu, 14 Nov 2019 00:36:58 +0530 Subject: [PATCH 02/22] Update index.html --- src/main/webapp/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html index ebe7e34..360f4a7 100644 --- a/src/main/webapp/index.html +++ b/src/main/webapp/index.html @@ -4,7 +4,7 @@ - Test Scribe + Test Scribe @@ -14,8 +14,8 @@

Sign into using OAuth Provider:

Google

Yahoo

Twitter

- +

This is multi branch

- \ No newline at end of file + From fd57d075e8ad416a6ee7922b8ac5bab79e1feb2f Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Thu, 14 Nov 2019 00:50:49 +0530 Subject: [PATCH 03/22] Update JenkinsFile --- JenkinsFile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JenkinsFile b/JenkinsFile index 7f466d9..2c689df 100644 --- a/JenkinsFile +++ b/JenkinsFile @@ -3,7 +3,7 @@ node{ git 'https://github.com/sohitsrivastava/scribe-java-webapp.git' } stage('Compile Package'){ - def mvnHome = tool name: 'Maven', type: 'maven' + def mvnHome = tool name: 'maven', type: 'maven' sh "${mvnHome}/bin/mvn package" } stage('Copy War File to Repo'){ From 50a7c1b6d37f5ce2d30232d5a6eb1aaddaeb3d7d Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Thu, 1 Apr 2021 18:13:27 +0530 Subject: [PATCH 04/22] Rename JenkinsFile to JenkinsFile_Old --- JenkinsFile => JenkinsFile_Old | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename JenkinsFile => JenkinsFile_Old (100%) diff --git a/JenkinsFile b/JenkinsFile_Old similarity index 100% rename from JenkinsFile rename to JenkinsFile_Old From 2598c9e7a3e4bab727a2bb8a1ec0a2bf59b4de65 Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Thu, 1 Apr 2021 18:13:52 +0530 Subject: [PATCH 05/22] Create JenkinsFile --- JenkinsFile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 JenkinsFile diff --git a/JenkinsFile b/JenkinsFile new file mode 100644 index 0000000..d45190f --- /dev/null +++ b/JenkinsFile @@ -0,0 +1,22 @@ +pipeline { + + agents any + PROJECT_ROOT="" + stages{ + + stage("SCM Checkout"){ + echo "Git Checkout Stage" + git https://github.com/sohitsrivastava/scribe-java-webapp.git + } + stage("Build Stage"){ + echo "Building project" + PROJECT_ROOT="${WORKSPACE}/scripe-java-webapp" + dir("${PROJECT_ROOT}"){ + pwd + ls -lrt + sh "mvn clean package" + } + + } + } +} From 7edd5ed0c76fea8a20be3aa73a038ddfe37c1c22 Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Thu, 1 Apr 2021 18:18:02 +0530 Subject: [PATCH 06/22] Update JenkinsFile --- JenkinsFile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JenkinsFile b/JenkinsFile index d45190f..4c4a901 100644 --- a/JenkinsFile +++ b/JenkinsFile @@ -6,7 +6,7 @@ pipeline { stage("SCM Checkout"){ echo "Git Checkout Stage" - git https://github.com/sohitsrivastava/scribe-java-webapp.git + git "https://github.com/sohitsrivastava/scribe-java-webapp.git" } stage("Build Stage"){ echo "Building project" From 81e488573798d2248cb77f902a84ada79fd05a67 Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Thu, 1 Apr 2021 18:24:13 +0530 Subject: [PATCH 07/22] Update JenkinsFile --- JenkinsFile | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/JenkinsFile b/JenkinsFile index 4c4a901..8233a2c 100644 --- a/JenkinsFile +++ b/JenkinsFile @@ -1,20 +1,29 @@ pipeline { - agents any + agent any PROJECT_ROOT="" stages{ stage("SCM Checkout"){ - echo "Git Checkout Stage" - git "https://github.com/sohitsrivastava/scribe-java-webapp.git" + steps { + script { + echo "Git Checkout Stage" + git "https://github.com/sohitsrivastava/scribe-java-webapp.git" + } + } + } stage("Build Stage"){ - echo "Building project" - PROJECT_ROOT="${WORKSPACE}/scripe-java-webapp" - dir("${PROJECT_ROOT}"){ - pwd - ls -lrt - sh "mvn clean package" + steps { + script { + echo "Building project" + PROJECT_ROOT="${WORKSPACE}/scripe-java-webapp" + dir("${PROJECT_ROOT}"){ + pwd + ls -lrt + sh "mvn clean package" + } + } } } From 484abadf53deb537a2c1814789134b9f5e5a6017 Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Thu, 1 Apr 2021 18:24:29 +0530 Subject: [PATCH 08/22] Update JenkinsFile --- JenkinsFile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JenkinsFile b/JenkinsFile index 8233a2c..c51c82d 100644 --- a/JenkinsFile +++ b/JenkinsFile @@ -1,6 +1,6 @@ pipeline { - agent any + agent master PROJECT_ROOT="" stages{ From 2b5aa043f84791c7b38e83db0c992a2fefedbb45 Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Thu, 1 Apr 2021 18:25:56 +0530 Subject: [PATCH 09/22] Update JenkinsFile --- JenkinsFile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/JenkinsFile b/JenkinsFile index c51c82d..272f00f 100644 --- a/JenkinsFile +++ b/JenkinsFile @@ -1,7 +1,7 @@ pipeline { - agent master - PROJECT_ROOT="" + agent none + PROJECT_ROOT='' stages{ stage("SCM Checkout"){ From 6d66a8c1f1ac7bdae9b292878be43252566c2e60 Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Thu, 1 Apr 2021 18:26:47 +0530 Subject: [PATCH 10/22] Update JenkinsFile --- JenkinsFile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/JenkinsFile b/JenkinsFile index 272f00f..1315608 100644 --- a/JenkinsFile +++ b/JenkinsFile @@ -1,9 +1,9 @@ pipeline { agent none - PROJECT_ROOT='' - stages{ + stages{ + PROJECT_ROOT='' stage("SCM Checkout"){ steps { script { From 9bb5641a794e9c53d82e7a44c0ca1a5fb59c2f88 Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Thu, 1 Apr 2021 18:29:49 +0530 Subject: [PATCH 11/22] Update JenkinsFile --- JenkinsFile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/JenkinsFile b/JenkinsFile index 1315608..3d204dd 100644 --- a/JenkinsFile +++ b/JenkinsFile @@ -1,9 +1,10 @@ pipeline { agent none - + environment { + PROJECT_ROOT='' + } stages{ - PROJECT_ROOT='' stage("SCM Checkout"){ steps { script { From 0b20ecb467706c11a372e3f2b69978431099e4ea Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Thu, 1 Apr 2021 18:31:25 +0530 Subject: [PATCH 12/22] Update JenkinsFile --- JenkinsFile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JenkinsFile b/JenkinsFile index 3d204dd..7dfd212 100644 --- a/JenkinsFile +++ b/JenkinsFile @@ -1,6 +1,6 @@ pipeline { - agent none + agent any environment { PROJECT_ROOT='' } From 064e90fe70ef17b45c8998b84f0afcc73d41243e Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Thu, 1 Apr 2021 18:33:44 +0530 Subject: [PATCH 13/22] Update JenkinsFile --- JenkinsFile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JenkinsFile b/JenkinsFile index 7dfd212..bb0f4f5 100644 --- a/JenkinsFile +++ b/JenkinsFile @@ -21,7 +21,7 @@ pipeline { PROJECT_ROOT="${WORKSPACE}/scripe-java-webapp" dir("${PROJECT_ROOT}"){ pwd - ls -lrt + sh "ls -lrt" sh "mvn clean package" } } From 7975927d2dd7894e8f8ee6a225e56b301caf87bf Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Thu, 1 Apr 2021 18:35:22 +0530 Subject: [PATCH 14/22] Update JenkinsFile --- JenkinsFile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JenkinsFile b/JenkinsFile index bb0f4f5..6da4188 100644 --- a/JenkinsFile +++ b/JenkinsFile @@ -1,6 +1,6 @@ pipeline { - agent any + agent { label 'master' } environment { PROJECT_ROOT='' } From 2cfd04b8798f8bac64063ad693c16ebf13e68398 Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Thu, 1 Apr 2021 18:36:22 +0530 Subject: [PATCH 15/22] Update JenkinsFile --- JenkinsFile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JenkinsFile b/JenkinsFile index 6da4188..5491cb7 100644 --- a/JenkinsFile +++ b/JenkinsFile @@ -18,7 +18,7 @@ pipeline { steps { script { echo "Building project" - PROJECT_ROOT="${WORKSPACE}/scripe-java-webapp" + PROJECT_ROOT="${WORKSPACE}/scribe-java-webapp" dir("${PROJECT_ROOT}"){ pwd sh "ls -lrt" From 6f6dd2a23ba0dd02bd793cdcdd598e145103a772 Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Thu, 1 Apr 2021 18:39:11 +0530 Subject: [PATCH 16/22] Update JenkinsFile --- JenkinsFile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JenkinsFile b/JenkinsFile index 5491cb7..fa174f0 100644 --- a/JenkinsFile +++ b/JenkinsFile @@ -18,7 +18,7 @@ pipeline { steps { script { echo "Building project" - PROJECT_ROOT="${WORKSPACE}/scribe-java-webapp" + PROJECT_ROOT="${WORKSPACE}" dir("${PROJECT_ROOT}"){ pwd sh "ls -lrt" From 93eda87c3c9b910f902ef489364aa599f719bdae Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Mon, 5 Apr 2021 10:12:08 +0530 Subject: [PATCH 17/22] Create Jenkinsfile_Jfrog_Usage --- Jenkinsfile_Jfrog_Usage | 72 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 Jenkinsfile_Jfrog_Usage diff --git a/Jenkinsfile_Jfrog_Usage b/Jenkinsfile_Jfrog_Usage new file mode 100644 index 0000000..e920d6b --- /dev/null +++ b/Jenkinsfile_Jfrog_Usage @@ -0,0 +1,72 @@ +pipeline { + + agent { label 'master' } + environment { + PROJECT_ROOT='' + } + stages{ + stage("SCM Checkout"){ + steps { + script { + echo "Git Checkout Stage" + git "https://github.com/sohitsrivastava/scribe-java-webapp.git" + } + } + + } + stage("Build Stage"){ + when{ + expression { return ACTION != "DEPLOY_ONLY" } + } + steps { + script { + echo "Building project" + PROJECT_ROOT="${WORKSPACE}" + dir("${PROJECT_ROOT}"){ + pwd + sh "ls -lrt" + sh "mvn clean package" + sh "mv ./target/*.war ./target/scribe-java-webapp-${VERSION}.war" + } + } + } + } + stage("Upload to Artifactory"){ + when{ + anyOf { + environment name: 'ACTION', value: 'BUILD_ONLY' + environment name: 'ACTION', value: 'BUILD_AND_DEPLOY' + } + } + steps { + script { + withCredentials([usernamePassword(credentialsId: 'artifactory_creds', usernameVariable: 'username', passwordVariable: 'pass')]) { + sh ''' + curl -u $username:$pass -X PUT "http://13.232.150.4:8080/artifactory/new-maven-local/${VERSION}/scribe-java-webapp.war" -T ${WORKSPACE}/target/*.war + ''' + } + } + } + } + stage("Download from Artifactory"){ + when{ + not { + environment name: 'ACTION', value: 'BUILD_ONLY' + } + } + steps { + script { + + sh "mkdir -p ${WORKSPACE}/downloadedartifacts/${VERSION}" + withCredentials([ + string(credentialsId: 'artifactory_api_key', variable: 'API_KEY'), + string(credentialsId: 'artifactory_user', variable: 'username')]) { + sh ''' + curl -u $username:$API_KEY -X GET "http://13.232.150.4:8080/artifactory/new-maven-local/${VERSION}/scribe-java-webapp.war" -o ${WORKSPACE}/downloadedartifacts/${VERSION}/scribe-java-webapp.war + ''' + } + } + } + } + } +} From 3e1d30c628003e319576f5544dc4c26a9f84e6f1 Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Mon, 26 Apr 2021 11:02:29 +0530 Subject: [PATCH 18/22] Create jenkinsfile_library --- jenkinsfile_library | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 jenkinsfile_library diff --git a/jenkinsfile_library b/jenkinsfile_library new file mode 100644 index 0000000..5e0e2c5 --- /dev/null +++ b/jenkinsfile_library @@ -0,0 +1,23 @@ +@Library('mysharedlibraries@master')_ +pipeline { + + agent { label 'master' } + environment { + PROJECT_ROOT='' + } + stages{ + stage("SCM Checkout"){ + steps { + script { + echo "Git Checkout Stage" + newgitchkout([ + URL='https://github.com/sohitsrivastava/scribe-java-webapp.git' + BRANCH='master' + ]) + } + } + + } + + } +} From 758c4a1abb699d42594fd43243343ea080a3d55d Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Mon, 26 Apr 2021 11:06:13 +0530 Subject: [PATCH 19/22] Update jenkinsfile_library --- jenkinsfile_library | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkinsfile_library b/jenkinsfile_library index 5e0e2c5..3396528 100644 --- a/jenkinsfile_library +++ b/jenkinsfile_library @@ -11,8 +11,8 @@ pipeline { script { echo "Git Checkout Stage" newgitchkout([ - URL='https://github.com/sohitsrivastava/scribe-java-webapp.git' - BRANCH='master' + URL : 'https://github.com/sohitsrivastava/scribe-java-webapp.git' + BRANCH : 'master' ]) } } From a274a1b096749f97ffe435c3fc21aaf67195edee Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Mon, 26 Apr 2021 11:07:42 +0530 Subject: [PATCH 20/22] Update jenkinsfile_library --- jenkinsfile_library | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkinsfile_library b/jenkinsfile_library index 3396528..8d57d72 100644 --- a/jenkinsfile_library +++ b/jenkinsfile_library @@ -11,8 +11,8 @@ pipeline { script { echo "Git Checkout Stage" newgitchkout([ - URL : 'https://github.com/sohitsrivastava/scribe-java-webapp.git' - BRANCH : 'master' + URL : 'https://github.com/sohitsrivastava/scribe-java-webapp.git', + BRANCH : 'master', ]) } } From c4a26c2fe43527410499273cf1d758c5d55daf77 Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Mon, 26 Apr 2021 11:12:14 +0530 Subject: [PATCH 21/22] Update jenkinsfile_library --- jenkinsfile_library | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkinsfile_library b/jenkinsfile_library index 8d57d72..bd8bef8 100644 --- a/jenkinsfile_library +++ b/jenkinsfile_library @@ -11,8 +11,8 @@ pipeline { script { echo "Git Checkout Stage" newgitchkout([ - URL : 'https://github.com/sohitsrivastava/scribe-java-webapp.git', - BRANCH : 'master', + URL='https://github.com/sohitsrivastava/scribe-java-webapp.git', + BRANCH='master', ]) } } From d342fecf773d56757fe5cc5a114916b1b76511ef Mon Sep 17 00:00:00 2001 From: sohitsrivastava Date: Mon, 26 Apr 2021 11:13:52 +0530 Subject: [PATCH 22/22] Update jenkinsfile_library --- jenkinsfile_library | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkinsfile_library b/jenkinsfile_library index bd8bef8..8d57d72 100644 --- a/jenkinsfile_library +++ b/jenkinsfile_library @@ -11,8 +11,8 @@ pipeline { script { echo "Git Checkout Stage" newgitchkout([ - URL='https://github.com/sohitsrivastava/scribe-java-webapp.git', - BRANCH='master', + URL : 'https://github.com/sohitsrivastava/scribe-java-webapp.git', + BRANCH : 'master', ]) } }