forked from demodevops2/java-hello-world-webapp
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathJenkinsfile
More file actions
38 lines (34 loc) · 812 Bytes
/
Jenkinsfile
File metadata and controls
38 lines (34 loc) · 812 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
38
pipeline{
agent any
tools {
maven 'maven3'
}
stages{
stage ('Initialize') {
steps {
sh '''
echo "PATH = ${PATH}"
echo "M2_HOME = ${M2_HOME}"
'''
}
}
stage('Checkout stage'){
steps{
git 'https://github.com/gkcloudtech777/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(['slave-id']) {
sh "scp -o StrictHostKeyChecking=no target/demo.war jenkins@172.31.11.237:/var/lib/tomcat10/webapps"
}
}
}
}
}