forked from DEVOPSA12/web-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile-scripted
39 lines (34 loc) · 1001 Bytes
/
Jenkinsfile-scripted
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
//scripted pipeline
node{
def MHD = tool name: "maven3.8.4"
stage('1.Initiation'){
sh "echo Start of td deployment"
}
stage('2.CloneCode'){
git branch: 'stage', credentialsId: 'GitHubCredentials', url: 'https://github.com/LandmakTechnology/web-app'
}
stage('3.buildMaven'){
sh "${MHD}/bin/mvn package"
}
stage('4.CodeQuality'){
//sh "${MHD}/bin/mvn sonar:sonar"
}
stage('5.UploadArtifacts'){
//sh "${MHD}/bin/mvn deploy"
}
stage('6.Deploy2Stage'){
sshagent(['32d5fb4f-d92f-4a10-9f12-2738eab55fcc']) {
sh "scp -o StrictHostKeyChecking=no target/*war [email protected]:/opt/tomcat9/webapps/app"
}
}
}
stage('7.Approval'){
timeout(time:5, unit:'DAYS'){
input message: 'Approval for production'
}
stage('8.deployToProd'){
sshagent(['32d5fb4f-d92f-4a10-9f12-2738eab55fcc']) {
sh "scp -o StrictHostKeyChecking=no target/*war [email protected]:/opt/tomcat9/webapps/"
}
}
}