Skip to content

Commit

Permalink
Create Jenkinsfile_declarativeDec2023
Browse files Browse the repository at this point in the history
  • Loading branch information
legah2045 authored Dec 22, 2023
1 parent adade40 commit 0334fa0
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions Jenkinsfile_declarativeDec2023
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
pipeline{
agent any
//options{}
//triggers{}
tools {
maven 'maven3.9.6'
}
stages{
stage('1clonecode'){
steps{
git "https://github.com/LandmakTechnology/maven-web-application"
}
}
stage('2mavenBuild'){
steps{
sh "echo 'running JUnit-test-cases' "
sh "echo 'testing must passed to create artifacts ' "
sh "mvn clean package"
}
}
stage('3CodeQuality'){
steps{
// sh "mvn sonar:sonar"
sh "echo CodeQualityAnalysis completed"
}
}
stage('4UploadArtifacts'){
steps{
//sh "mvn deploy"
sh "echo artifacts uploaded successfully"
sh "echo I am now a Build and Release Engineer"
sh "echo Build and release completed"
}
}
stage('5deploy2UAT'){
steps{
sh "echo Deployment is ready for the client review"
deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://10.0.0.38:8088/')], contextPath: null, war: 'target/*war '

}
}
stage('6manualApproval'){
steps{
sh "echo Review the application and confirm its performance within 5 hours"
timeout(time:5, unit:'HOURS') {
input message: 'Application ready for deployment, Please review and approve'
}
}
}
stage('7deploy2prod'){
steps{
sh "echo application reviewed, approved and ready for the market"
deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://10.0.0.38:8088/')], contextPath: null, war: 'target/*war '

}
}
}
post{
always{
emailext body: '''Hi,

Build status.

Landmark Technologies.
Tel: +1 437 215 2483''', recipientProviders: [developers(), requestor(), buildUser()], subject: 'Build status', to: '[email protected]'

}
success {
emailext body: '''Hi,

Build successful.

Landmark Technologies.
Tel: +1 437 215 2483''', recipientProviders: [developers(), requestor(), buildUser()], subject: 'Build status', to: '[email protected]'

}
failure{
emailext body: '''Hi,

Build failed.

Landmark Technologies.
Tel: +1 437 215 2483''', recipientProviders: [developers(), requestor(), buildUser()], subject: 'Build status', to: '[email protected]'

}
}
}

0 comments on commit 0334fa0

Please sign in to comment.