forked from demodevops2/java-hello-world-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
37 lines (34 loc) · 995 Bytes
/
Copy pathJenkinsfile
File metadata and controls
37 lines (34 loc) · 995 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
33
34
35
36
37
pipeline{
agent any
tools {
maven 'Maven'
}
stages{
stage ('Initialize') {
steps {
sh '''
echo "PATH = ${PATH}"
echo "M2_HOME = ${M2_HOME}"
'''
}
}
stage('checkout stage'){
steps{
git credentialsId: '8b4d5611-418f-48f0-a831-02baf2b87c75', url: 'https://github.com/rajuk999/java-hello-world-webapp.git'
}
}
stage('Build-stage'){
steps{
sh 'mvn clean package'
sh 'mv target/*.war target/demo.war'
}
}
stage('deploy war file'){
steps{
sshagent(['ec2-id']) {
sh "scp -o StrictHostKeyChecking=no target/demo.war ubuntu@172.31.5.153:/opt/tomcat/webapps"
}
}
}
}
}