forked from maniumjayaraj/SaiJavaCode
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
26 lines (26 loc) · 796 Bytes
/
Jenkinsfile
File metadata and controls
26 lines (26 loc) · 796 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
pipeline{
agent any
stages{
stage("Git Checkout"){
steps{
git credentialsId: 'github', url: 'https://github.com/machakiran/SaiJavaCode.git'
}
}
stage("Maven Build"){
steps{
sh "/opt/apache-maven-3.8.3/bin/mvn package"
}
}
stage("deploy-dev"){
steps{
sshagent(['18.206.249.222']) {
sh """
scp -o StrictHostKeyChecking=no /var/lib/jenkins/workspace/jenkins3/webapp/target/webapp.war ubuntu@18.206.249.222:/opt/apache-tomcat-8.5.72/webapps
ssh ubuntu@18.206.249.222 /opt/apache-tomcat-8.5.72/bin/shutdown.sh
ssh ubuntu@18.206.249.222 /opt/apache-tomcat-8.5.72/bin/startup.sh
"""
}
}
}
}
}