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
1 changed file
with
63 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,63 @@ | ||
pipeline{ | ||
agent any | ||
tools { | ||
maven "maven3.6.0" | ||
} | ||
stages { | ||
stage('1GetCode'){ | ||
steps{ | ||
sh "echo 'cloning the latest application version' " | ||
git branch: 'feature', credentialsId: 'gitHubCredentials', url: 'https://github.com/LandmakTechnology/maven-web-application' | ||
} | ||
} | ||
stage('3Test+Build'){ | ||
steps{ | ||
sh "echo 'running JUnit-test-cases' " | ||
sh "echo 'testing must passed to create artifacts ' " | ||
sh "mvn clean package" | ||
} | ||
} | ||
stage('4CodeQuality'){ | ||
steps{ | ||
sh "echo 'Perfoming CodeQualityAnalysis' " | ||
sh "mvn sonar:sonar" | ||
} | ||
} | ||
stage('5uploadNexus'){ | ||
steps{ | ||
sh "mvn deploy" | ||
} | ||
} | ||
stage('8deploy2prod'){ | ||
steps{ | ||
deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.131:8080/')], contextPath: null, war: 'target/*war' | ||
} | ||
} | ||
} | ||
post{ | ||
always{ | ||
emailext body: '''Hey guys | ||
Please check build status. | ||
|
||
Thanks | ||
Landmark | ||
+1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: '[email protected]' | ||
} | ||
success{ | ||
emailext body: '''Hey guys | ||
Good job build and deployment is successful. | ||
|
||
Thanks | ||
Landmark | ||
+1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: '[email protected]' | ||
} | ||
failure{ | ||
emailext body: '''Hey guys | ||
Build failed. Please resolve issues. | ||
|
||
Thanks | ||
Landmark | ||
+1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: '[email protected]' | ||
} | ||
} | ||
} |