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.
Create Jenkinsfile_declarative042023
- Loading branch information
Showing
1 changed file
with
69 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,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]' | ||
|
||
} | ||
|
||
} | ||
|
||
} |