forked from LandmakTechnology/maven-web-application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjenkinsscriptjoke
42 lines (37 loc) · 1.69 KB
/
jenkinsscriptjoke
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
node{
def mavenHome = tool name: 'maven3.9.1'
stage('1.CodeClone'){
// sh "git clone https://github.com/jadedeblessed/maven-web-application"
//bat "git clone https://github.com/LandmakTechnology/maven-web-application"
git credentialsId: 'git-credentials', url: 'https://github.com/jadedeblessed/web-app-private'
}
stage('2MavenBuild'){
sh "${mavenHome}/bin/mvn package"
}
stage('3codeQuality'){
sh "${mavenHome}/bin/mvn sonar:sonar"
}
stage('4UploadArtifacts'){
sh "${mavenHome}/bin/mvn deploy"
}
stage('5deploy2UAT'){
// deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://18.191.186.30:8080/')], contextPath: null, war: 'target/*war'
//deploy contextPath: ' http://18.191.186.30:8080/', war: 'target/*.war'
deploy adapters: [tomcat9(credentialsId: 'tomcatcredentials', path: '', url: 'http://18.191.186.30:8080/')], contextPath: null, onFailure: false, war: 'target/*.war'
}
stage('6Manualapproval'){
sh "echo 'ready for review' "
timeout(time:5, unit:'HOURS') {
input message: 'Application ready for deployment, Please review and approve'
}
}
stage('7deploy2Prod'){
//deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://100.26.217.86:8080/')], contextPath: null, war: 'target/*war'
deploy adapters: [tomcat9(credentialsId: 'tomcatcredentials', path: '', url: 'http://18.191.186.30:8080/')], contextPath: null, onFailure: false, war: 'target/*.war'
}
stage('8emailNotify'){
emailext body: '''Hello Team,
Build is done.
LANDMARKTECH''', recipientProviders: [developers(), contributor(), upstreamDevelopers()], subject: 'Build Status', to: '[email protected]'
}
}