Skip to content

Commit

Permalink
Create war-ci-cd-tomcat
Browse files Browse the repository at this point in the history
  • Loading branch information
javahometech authored Apr 28, 2019
1 parent b85968a commit 2befaab
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions war-ci-cd-tomcat
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
node('master'){

stage('SCM Checkout'){
git branch: 'master',
credentialsId: 'github',
url: 'https://github.com/javahometech/myweb'
}

stage('MVN Build'){
def mvnHome = tool name: 'maven3', type: 'maven'
def mvn = "$mvnHome/bin/mvn"
sh label: '', script: "$mvn clean package"
}

stage('Deploy-Dev'){
// copy war from here to remote tomcat// ssh agent plugin
// restart tomcat

sshagent(['tomcat-dev']) {
sh "mv target/myweb*.war target/myweb.war"

sh "scp -o StrictHostKeyChecking=no target/myweb.war [email protected]:/opt/tomcat8/webapps/"

sh "ssh [email protected] /opt/tomcat8/bin/startup.sh"
}
}

}

0 comments on commit 2befaab

Please sign in to comment.