forked from gkcloudtech777/java-hello-world-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
32 lines (32 loc) · 767 Bytes
/
Copy pathJenkinsfile
File metadata and controls
32 lines (32 loc) · 767 Bytes
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
pipeline {
agent any
tools {
maven 'maven'
}
stages{
stage('Initialize'){
steps{
sh 'echo "PATH = ${PATH}"'
sh 'echo "M2_HOME = ${M2_HOME}"'
}
}
stage('Checkout stage'){
steps{
git 'https://github.com/kpraju123/java-hello-world-webapp.git'
}
}
stage('Build-stage'){
steps{
sh 'mvn clean package'
sh 'mv target/*.war target/demo.war'
}
}
stage('Deploy-stage'){
steps{
sshagent(['ec2-id']) {
sh '''scp -o Stricthostkeychecking=no target/demo.war ubuntu@172.31.39.34:/var/lib/tomcat9/webapps'''
}
}
}
}
}