Skip to content

Commit

Permalink
Create Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
legah2045 authored Sep 21, 2022
1 parent 266291e commit 45d8934
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
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 45d8934

Please sign in to comment.