Skip to content

Commit 60dddaf

Browse files
authored
Create Jenkinsfile-scripted
1 parent 3cd3da1 commit 60dddaf

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

Jenkinsfile-scripted

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
//scripted pipeline
2+
node{
3+
def MHD = tool name: "maven3.8.4"
4+
stage('1.Initiation'){
5+
sh "echo Start of td deployment"
6+
}
7+
stage('2.CloneCode'){
8+
git branch: 'stage', credentialsId: 'GitHubCredentials', url: 'https://github.com/LandmakTechnology/web-app'
9+
}
10+
stage('3.buildMaven'){
11+
sh "${MHD}/bin/mvn package"
12+
}
13+
stage('4.CodeQuality'){
14+
//sh "${MHD}/bin/mvn sonar:sonar"
15+
}
16+
stage('5.UploadArtifacts'){
17+
//sh "${MHD}/bin/mvn deploy"
18+
}
19+
stage('6.Deploy2Stage'){
20+
sshagent(['32d5fb4f-d92f-4a10-9f12-2738eab55fcc']) {
21+
sh "scp -o StrictHostKeyChecking=no target/*war ec2-user@172.31.15.31:/opt/tomcat9/webapps/app"
22+
}
23+
24+
}
25+
}
26+
stage('7.Approval'){
27+
timeout(time:5, unit:'DAYS'){
28+
input message: 'Approval for production'
29+
30+
}
31+
stage('8.deployToProd'){
32+
sshagent(['32d5fb4f-d92f-4a10-9f12-2738eab55fcc']) {
33+
sh "scp -o StrictHostKeyChecking=no target/*war ec2-user@172.31.15.31:/opt/tomcat9/webapps/"
34+
}
35+
36+
}
37+
}
38+
39+

0 commit comments

Comments
 (0)