Skip to content

Commit b1ef153

Browse files
authored
Create Jenkinsfile
1 parent 30d59c5 commit b1ef153

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Jenkinsfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
pipeline{
2+
agent any
3+
stages{
4+
stage("Git Checkout"){
5+
steps{
6+
git credentialsId: 'github', url: 'https://github.com/machakiran/SaiJavaCode.git'
7+
}
8+
}
9+
stage("Maven Build"){
10+
steps{
11+
sh "/opt/apache-maven-3.8.3/bin/mvn package"
12+
}
13+
}
14+
stage("deploy-dev"){
15+
steps{
16+
sshagent(['18.206.249.222']) {
17+
sh """
18+
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
19+
ssh ubuntu@18.206.249.222/opt/apache-tomcat-8.5.72/bin/shutdown.sh
20+
ssh ubuntu@18.206.249.222/opt/apache-tomcat-8.5.72/bin/startup.sh
21+
"""
22+
}
23+
}
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)