Skip to content

Commit

Permalink
Create Jenkinsfiles-declarative29
Browse files Browse the repository at this point in the history
  • Loading branch information
legah2045 authored Sep 21, 2022
1 parent 1993c9a commit 29522e9
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions Jenkinsfiles-declarative29
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]'
}
}
}

0 comments on commit 29522e9

Please sign in to comment.