forked from Landmark-Technologies/maven-web-application
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
222 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
pipeline{ | ||
|
||
agent any | ||
|
||
tools | ||
{ | ||
maven 'maven3.6.3' | ||
|
||
} | ||
|
||
triggers{ | ||
pollSCM('* * * * *') | ||
} | ||
|
||
options{ | ||
timestamps() | ||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '2', daysToKeepStr: '', numToKeepStr: '2')) | ||
} | ||
|
||
stages{ | ||
|
||
stage('CheckoutCode') | ||
{ | ||
steps{ | ||
git branch: 'development', credentialsId: '8e348aa2-9531-4dbe-863d-1adb64897470', url: 'https://github.com/LandmakTechnology/maven-web-application.git' | ||
} | ||
} | ||
|
||
stage('Build') | ||
{ | ||
steps{ | ||
sh "mvn clean package" | ||
} | ||
} | ||
|
||
stage('ExecuteSonarQubeReport') | ||
{ | ||
steps{ | ||
sh "mvn sonar:sonar" | ||
} | ||
} | ||
|
||
stage('UploadArtifactintoNexus') | ||
{ | ||
steps{ | ||
sh "mvn deploy" | ||
} | ||
} | ||
|
||
stage('DeployAppIntoTomcat') | ||
{ | ||
steps{ | ||
sshagent(['2b7b0c6a-5eff-4f4a-82c3-3630f91c70b5']) { | ||
sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war [email protected]:/opt/apache-tomcat-9.0.41/webapps/" | ||
} | ||
} | ||
} | ||
|
||
|
||
|
||
} | ||
|
||
post{ | ||
|
||
|
||
success{ | ||
mail bcc: '[email protected]', body: '''BuildOver!.... | ||
|
||
Regards, | ||
Landmark Technologies, | ||
9980923226''', cc: '[email protected]', from: '', replyTo: '', subject: 'BuildOver!!', to: '[email protected]' | ||
} | ||
|
||
failure{ | ||
mail bcc: '[email protected]', body: '''BuildOver!.... | ||
|
||
Regards, | ||
Landmark Technologies, | ||
+1 437 215 2483,''', cc: '[email protected]', from: '', replyTo: '', subject: 'BuildOver!!', to: '[email protected]' | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
node('wallmart-node'){ | ||
|
||
def mavenHome = tool name: "maven3.8.2" | ||
|
||
echo "GitHub BranhName ${env.BRANCH_NAME}" | ||
echo "Jenkins Job Number ${env.BUILD_NUMBER}" | ||
echo "Jenkins Node Name ${env.NODE_NAME}" | ||
|
||
echo "Jenkins Home ${env.JENKINS_HOME}" | ||
echo "Jenkins URL ${env.JENKINS_URL}" | ||
echo "JOB Name ${env.JOB_NAME}" | ||
|
||
stage('CheckOutCode') | ||
{ | ||
git branch: 'development', credentialsId: '12993250-1ff3-40a0-9978-794e74dcf712', url: 'https://github.com/LandmakTechnology/maven-web-application.git' | ||
} | ||
|
||
stage('Build') | ||
{ | ||
sh "${mavenHome}/bin/mvn clean package" | ||
} | ||
|
||
/* | ||
stage('SonarQubeReport'){ | ||
sh "${mavenHome}/bin/mvn clean sonar:sonar" | ||
} | ||
|
||
|
||
stage('UploadArtifactIntoNexus'){ | ||
sh "${mavenHome}/bin/mvn clean deploy" | ||
} | ||
|
||
stage('DeployAppIntoTomcatServer') | ||
{ | ||
sshagent(['c7a7b3d8-55f0-4f83-9e81-d56c154cc647']) { | ||
sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war [email protected]:/opt/apache-tomcat-9.0.52/webapps/" | ||
} | ||
} | ||
|
||
*/ | ||
|
||
stage('SendEmailNotification'){ | ||
emailext body: '''Build is over !! | ||
|
||
Regards, | ||
Landmark Technologies, | ||
9980923226''', subject: 'Build Over... !!', to: '[email protected]' | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
pipeline{ | ||
|
||
agent{ | ||
label 'slaves' | ||
} | ||
|
||
tools{ | ||
maven 'maven3.6.3' | ||
|
||
} | ||
|
||
triggers{ | ||
pollSCM('* * * * *') | ||
} | ||
|
||
options{ | ||
timestamps() | ||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '5', daysToKeepStr: '', numToKeepStr: '5')) | ||
} | ||
|
||
stages{ | ||
|
||
stage('CheckOutCode'){ | ||
steps{ | ||
git branch: 'development', credentialsId: '957b543e-6f77-4cef-9aec-82e9b0230975', url: 'https://github.com/LandmakTechnology/maven-web-application-1.git' | ||
|
||
} | ||
} | ||
|
||
stage('Build'){ | ||
steps{ | ||
sh "mvn clean package" | ||
} | ||
} | ||
/* | ||
stage('ExecuteSonarQubeReport'){ | ||
steps{ | ||
sh "mvn clean sonar:sonar" | ||
} | ||
} | ||
|
||
stage('UploadArtifactsIntoNexus'){ | ||
steps{ | ||
sh "mvn clean deploy" | ||
} | ||
} | ||
|
||
stage('DeployAppIntoTomcat'){ | ||
steps{ | ||
sshagent(['bfe1b3c1-c29b-4a4d-b97a-c068b7748cd0']) { | ||
sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war [email protected]:/opt/apache-tomcat-9.0.50/webapps/" | ||
} | ||
} | ||
} | ||
*/ | ||
}//Stages Closing | ||
|
||
post{ | ||
|
||
success{ | ||
emailext to: '[email protected],[email protected]', | ||
subject: "Pipeline Build is over .. Build # is ..${env.BUILD_NUMBER} and Build status is.. ${currentBuild.result}.", | ||
body: "Pipeline Build is over .. Build # is ..${env.BUILD_NUMBER} and Build status is.. ${currentBuild.result}.", | ||
replyTo: '[email protected]' | ||
} | ||
|
||
failure{ | ||
emailext to: '[email protected],[email protected]', | ||
subject: "Pipeline Build is over .. Build # is ..${env.BUILD_NUMBER} and Build status is.. ${currentBuild.result}.", | ||
body: "Pipeline Build is over .. Build # is ..${env.BUILD_NUMBER} and Build status is.. ${currentBuild.result}.", | ||
replyTo: '[email protected]' | ||
} | ||
|
||
} | ||
|
||
|
||
}//Pipeline closing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: '3.1' | ||
services: | ||
springboot: | ||
image: mylandmarktech/maven-web-app:VERSION | ||
restart: always | ||
ports: | ||
- 9090:8080 | ||
networks: | ||
- mavenappbridge | ||
networks: | ||
mavenappbridge: |
0a0b140
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated