Skip to content

Commit 6d980fe

Browse files
authored
Create jenkins
1 parent 2174e7c commit 6d980fe

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

jenkins

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
pipeline{
2+
agent any
3+
stages{
4+
stage("Git Checkout"){
5+
steps{
6+
git credentialsId: 'github', url: 'https://github.com/aditya-malviya/myweb.git'
7+
}
8+
}
9+
stage("Maven Build"){
10+
steps{
11+
sh "mvn clean package"
12+
sh "mv target/*.war target/myweb.war"
13+
}
14+
}
15+
stage("deploy-dev"){
16+
steps{
17+
sshagent(['tomcat-dev1']) {
18+
sh """
19+
scp -o StrictHostKeyChecking=no target/myweb.war
20+
ubuntu@yourip:/opt/tomcat/webapps/
21+
ssh ubuntu@yourip /opt/tomcat/bin/shutdown.sh
22+
ssh ubuntu@yourip /opt/tomcat/bin/startup.sh
23+
"""
24+
}
25+
}
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)