Skip to content

Commit f3c843b

Browse files
authored
Create Jenkinsfile_March2023
1 parent ba8973b commit f3c843b

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

Jenkinsfile_March2023

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
node{
2+
def mavenHome = tool name: 'maven3.9.1'
3+
stage('1.CodeClone'){
4+
git credentialsId: 'gitHubCredentials', url: 'https://github.com/LandmakTechnology/maven-web-application'
5+
}
6+
stage('2MavenBuild'){
7+
sh "${mavenHome}/bin/mvn package"
8+
}
9+
stage('3codeQuality'){
10+
sh "${mavenHome}/bin/mvn sonar:sonar"
11+
}
12+
stage('4UploadArtifacts'){
13+
sh "${mavenHome}/bin/mvn deploy"
14+
}
15+
stage('5deploy2UAT'){
16+
deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://100.26.217.86:8080/')], contextPath: null, war: 'target/*war'
17+
}
18+
stage('6Manualapproval'){
19+
sh "echo 'ready for review' "
20+
timeout(time:5, unit:'HOURS') {
21+
input message: 'Application ready for deployment, Please review and approve'
22+
}
23+
}
24+
stage('7deploy2Prod'){
25+
deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://100.26.217.86:8080/')], contextPath: null, war: 'target/*war'
26+
}
27+
stage('8emailNotify'){
28+
emailext body: '''Hello Team,
29+
30+
Build is done.
31+
32+
LANDMARKTECH''', recipientProviders: [developers(), contributor(), upstreamDevelopers()], subject: 'Build Status', to: '[email protected]'
33+
}
34+
35+
}

0 commit comments

Comments
 (0)