forked from srinivas1987devops/myweb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
javahometech
authored
Apr 28, 2019
1 parent
b85968a
commit 2befaab
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
|
||
} |