Skip to content

Commit

Permalink
Create Jenkinsfile_declarative042023
Browse files Browse the repository at this point in the history
  • Loading branch information
legah2045 authored Apr 1, 2023
1 parent 89d83f3 commit d550c92
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions Jenkinsfile_declarative042023
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
pipeline{
agent {
label 'master'
}
tools {
maven 'maven3.9.1'
}
//options{}
//triggers{}
stages {
stage('1Clone'){
steps{
sh "echo 'cloning the latest application version' "
git "https://github.com/LandmakTechnology/maven-web-application"
sh "echo 'latest application version available for testing and build' "
}
}
stage('2TestBuild'){
steps{
sh "echo 'running JUnit-test-cases' "
sh "echo 'testing must passed to create artifacts ' "
sh "mvn clean package"
}
}
stage('3CodeQualityAnalysis') {
steps{
sh "echo setup sonarQube authentication"
sh "echo 'Perfoming CodeQualityAnalysis' "
sh "mvn sonar:sonar"
}
}
stage('4UploadArtifacts') {
steps{
sh "echo configure nexus authentication"
//sh "mvn deploy"
sh "echo artifacts uploaded"
}
}
stage('5deploy') {
steps{
deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://100.26.217.86:8080/')], contextPath: null, war: 'target/*war'
}
}

//stage('5deploy') {}
}
post{
always{
emailext body: '''Great job team.

LandmarkTech ''', recipientProviders: [buildUser(), developers()], subject: 'Build Success', to: '[email protected]'

}
success{
emailext body: '''Great job team.

LandmarkTech ''', recipientProviders: [buildUser(), developers()], subject: 'Build Success', to: '[email protected]'

}
failure{
emailext body: '''Please review this job.

LandmarkTech ''', recipientProviders: [buildUser(), developers()], subject: 'Build failed', to: '[email protected]'

}

}

}

0 comments on commit d550c92

Please sign in to comment.