forked from daticahealth/java-tomcat-maven-example
-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathJenkinsfileTest
More file actions
20 lines (19 loc) · 696 Bytes
/
Copy pathJenkinsfileTest
File metadata and controls
20 lines (19 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
node{
stage('Checkout'){
git 'https://github.com/rajnikhattarrsinha/java-tomcat-maven-example'
}
stage('Build'){
// Get maven home path and build
def mvnHome = tool name: 'Maven 3.5.4', type: 'maven'
sh "${mvnHome}/bin/mvn package"
}
stage ('Test'){
def mvnHome = tool name: 'Maven 3.5.4', type: 'maven'
sh "${mvnHome}/bin/mvn verify; sleep 3"
}
stage('Deploy') {
sshagent(['abeab169-3c7e-4291-98f3-7f190a3d4099']) {
sh 'scp -o StrictHostKeyChecking=no target/*.war root@52.87.209.191:/opt/tomcat/webapps'
}
}
}