From cce8eabe1b43836935badd7f65db5b63b1146ae7 Mon Sep 17 00:00:00 2001 From: taiwoabbey <99892967+taiwoabbey@users.noreply.github.com> Date: Fri, 25 Mar 2022 10:44:43 -0500 Subject: [PATCH 1/8] Update JenkinsDeclarativePipelineScript --- JenkinsDeclarativePipelineScript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JenkinsDeclarativePipelineScript b/JenkinsDeclarativePipelineScript index fdae01e..de94570 100644 --- a/JenkinsDeclarativePipelineScript +++ b/JenkinsDeclarativePipelineScript @@ -2,7 +2,7 @@ pipeline{ agent any tools { - maven "maven3.8.4" + maven "maven3.8.5" } triggers { pollSCM '* * * * * ' From 17fc618898fb3ecc032cb84e9662e2a53a43e332 Mon Sep 17 00:00:00 2001 From: taiwoabbey <99892967+taiwoabbey@users.noreply.github.com> Date: Fri, 25 Mar 2022 10:46:01 -0500 Subject: [PATCH 2/8] Create jenkins27 --- jenkins27 | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 jenkins27 diff --git a/jenkins27 b/jenkins27 new file mode 100644 index 0000000..2e4d048 --- /dev/null +++ b/jenkins27 @@ -0,0 +1,47 @@ +node{ + def mavenHome = tool name: 'maven3.8.5' + stage('1.Clone'){ + git branch: 'master', credentialsId: 'Git_Credentials', url: 'https://github.com/LandmakTechnology/paypal-web-app' + } + stage('2.MavenBuild'){ + sh "${mavenHome}/bin/mvn clean package" + // bat 'mvn package' + } + /* stage('3.CodeQuality'){ + sh "${mavenHome}/bin/mvn sonar:sonar" + } + stage('4.UploadArtifacts'){ + sh "${mavenHome}/bin/mvn deploy" + } + stage('6.Deploy2dev'){ + deploy adapters: [tomcat9(credentialsId: 'Tomcat_Credentials', path: '', url: 'http://18.207.210.70:8080/')], contextPath: null, war: 'target/web-app.war' +} + stage('5.Deploy2uat'){ + sshagent(['agentcredentials']) { + // sh "scp -o StrictHostKeyChecking=no target/*.war ec2-user@172.31.89.218:/opt/tomcat9/webapps/uat.war" + +} + + } + stage('7.approval'){ + timeout(time:8, unit:'HOURS'){ + input message: 'Please approve deployment to Production' + } + } + stage('8.Deploy2prod'){ + sshagent(['agentcredentials']) { + sh "scp -o StrictHostKeyChecking=no target/*.war ec2-user@172.31.89.218:/opt/tomcat9/webapps/app.war" + +} + + } + stage('9.EmailAlerts'){ + emailext body: '''Hi + +Build status for boa app. + +Regards, +Landmark Technologies''', recipientProviders: [developers(), requestor()], subject: 'Project status', to: 'boa@gmail.com' + } + */ +} From 3b3a23c834a22161095aa3d21f4b2a8ecd0fa6fa Mon Sep 17 00:00:00 2001 From: taiwoabbey <99892967+taiwoabbey@users.noreply.github.com> Date: Fri, 25 Mar 2022 10:53:13 -0500 Subject: [PATCH 3/8] Create JenkinsDeclarativePipelineScriptMarch2022 --- JenkinsDeclarativePipelineScriptMarch2022 | 83 +++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 JenkinsDeclarativePipelineScriptMarch2022 diff --git a/JenkinsDeclarativePipelineScriptMarch2022 b/JenkinsDeclarativePipelineScriptMarch2022 new file mode 100644 index 0000000..aaa61c5 --- /dev/null +++ b/JenkinsDeclarativePipelineScriptMarch2022 @@ -0,0 +1,83 @@ +pipeline{ + agent any + tools{ + maven "maven3.8.4" + } + stages{ + stage('1.clone'){ + steps{ + sh "echo clonning the latest version of the code" + git branch: 'feature', credentialsId: 'Git_Credentials', url: 'https://github.com/LandmakTechnology/paypal-web-app' + sh "echo clonning successful" + } + } + stage('2.Build'){ + steps{ + sh "echo validation, compilation, testing and package" + sh "echo testing successful and ready to package" + sh "mvn clean package" + } + } + stage('3.Quality'){ + steps{ + sh "echo performing code quality analysis" + sh "echo code quality successful and ready to upload" + sh "mvn sonar:sonar" + } + } + stage('4.uploadArtifacts'){ + steps{ + sh "mvn deploy" + } + } + stage('5.Deploy2UAT'){ + steps{ + sh "echo DEPLOYING TO UAT for further testing and validation" + sshagent(['agentcredentials']) { + sh "scp -o StrictHostKeyChecking=no target/*.war ec2-user@172.31.89.218:/opt/tomcat9/webapps/uatapp.war" + } + } + } + stage('6.Deploy2Prod'){ + steps{ + sh "echo DEPLOYING application TO Production" + timeout(time:8, unit:'HOURS'){ + input message: 'Please approve deployment to Production' + } + sshagent(['agentcredentials']) { + sh "scp -o StrictHostKeyChecking=no target/*.war ec2-user@172.31.89.218:/opt/tomcat9/webapps/app.war" + } + } + } + } + post{ + always{ + mail bcc: 'mylandmarktech@gmail.com', body: '''Success, + +The build was great. + +Regards +Landmark Technologies ++14372152483''', cc: 'mylandmarktech@gmail.com', from: '', replyTo: '', subject: 'sucess', to: 'mylandmarktech@gmail.com' + } + success{ + mail bcc: 'mylandmarktech@gmail.com', body: '''Success, + +The build was great. + +Regards +Landmark Technologies ++14372152483''', cc: 'mylandmarktech@gmail.com', from: '', replyTo: '', subject: 'sucess', to: 'mylandmarktech@gmail.com' + } + failure{ + mail bcc: 'mylandmarktech@gmail.com', body: '''Failed, + +The build Failed. + +Regards +Landmark Technologies ++14372152483''', cc: 'mylandmarktech@gmail.com', from: '', replyTo: '', subject: 'Failed', to: 'mylandmarktech@gmail.com' + } + } + +} From e6ef4896f5eb8deb6405c1867375a76358ad432c Mon Sep 17 00:00:00 2001 From: taiwoabbey <99892967+taiwoabbey@users.noreply.github.com> Date: Fri, 25 Mar 2022 11:01:41 -0500 Subject: [PATCH 4/8] Update Jenkinsfile27 --- Jenkinsfile27 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile27 b/Jenkinsfile27 index c0d2106..2e4d048 100644 --- a/Jenkinsfile27 +++ b/Jenkinsfile27 @@ -1,5 +1,5 @@ node{ - def mavenHome = tool name: 'maven3.8.4' + def mavenHome = tool name: 'maven3.8.5' stage('1.Clone'){ git branch: 'master', credentialsId: 'Git_Credentials', url: 'https://github.com/LandmakTechnology/paypal-web-app' } From 6b8ff484c2aa43fc8e04a5e0ddb9d1e9d873b917 Mon Sep 17 00:00:00 2001 From: taiwoabbey <99892967+taiwoabbey@users.noreply.github.com> Date: Fri, 25 Mar 2022 11:07:52 -0500 Subject: [PATCH 5/8] Update JenkinsDeclarativePipelineScriptMarch2022 --- JenkinsDeclarativePipelineScriptMarch2022 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JenkinsDeclarativePipelineScriptMarch2022 b/JenkinsDeclarativePipelineScriptMarch2022 index aaa61c5..114164c 100644 --- a/JenkinsDeclarativePipelineScriptMarch2022 +++ b/JenkinsDeclarativePipelineScriptMarch2022 @@ -1,7 +1,7 @@ pipeline{ agent any tools{ - maven "maven3.8.4" + maven "maven3.8.5" } stages{ stage('1.clone'){ From 585386301a5e7baeda891d5fb18462a63d7f32fd Mon Sep 17 00:00:00 2001 From: taiwoabbey <99892967+taiwoabbey@users.noreply.github.com> Date: Fri, 25 Mar 2022 11:08:08 -0500 Subject: [PATCH 6/8] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0830d89..9149070 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ node{ - def MHD = tool name: "maven3.8.4" + def MHD = tool name: "maven3.8.5" stage('code'){ git branch: 'development', url: 'https://github.com/LandmakTechnology/web-app' } From 0654d456e5a47540d6d764d54cef14bb80a2c1e7 Mon Sep 17 00:00:00 2001 From: taiwoabbey <99892967+taiwoabbey@users.noreply.github.com> Date: Fri, 25 Mar 2022 11:08:27 -0500 Subject: [PATCH 7/8] Update Jenkinsfile-scripted --- Jenkinsfile-scripted | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-scripted b/Jenkinsfile-scripted index 820c418..10ddae5 100644 --- a/Jenkinsfile-scripted +++ b/Jenkinsfile-scripted @@ -1,6 +1,6 @@ //scripted pipeline node{ - def MHD = tool name: "maven3.8.4" + def MHD = tool name: "maven3.8.5" stage('1.Initiation'){ sh "echo Start of td deployment" } From e727c10a9a74f7d2d87cc10c89164b6f352e12d0 Mon Sep 17 00:00:00 2001 From: taiwoabbey <99892967+taiwoabbey@users.noreply.github.com> Date: Fri, 25 Mar 2022 11:08:41 -0500 Subject: [PATCH 8/8] Update Jenkinsfile_boa --- Jenkinsfile_boa | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile_boa b/Jenkinsfile_boa index 494bb53..7110aa4 100644 --- a/Jenkinsfile_boa +++ b/Jenkinsfile_boa @@ -1,5 +1,5 @@ node{ - def mavenHome = tool name: 'maven3.8.4' + def mavenHome = tool name: 'maven3.8.5' stage('1.Clone'){ git branch: 'master', credentialsId: 'Git_Credentials', url: 'https://github.com/LandmakTechnology/paypal-web-app' }