forked from effectivejenkins/spring-petclinic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
25 lines (25 loc) · 777 Bytes
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
pipeline {
agent { label 'master' }
stages {
stage ('Checkout') {
steps {
git 'https://github.com/preetam810/spring-petclinic.git'
}
}
stage('Build') {
agent { docker 'maven:3.5-alpine' }
steps {
sh 'mvn clean package'
junit '**/target/surefire-reports/TEST-*.xml'
archiveArtifacts artifacts: 'target/*.jar', fingerprint: true
}
}
stage('Deploy') {
steps {
input 'Do you approve the deployment?'
sh 'scp target/*.jar jenkins@192.168.50.10:/opt/pet/'
sh "ssh jenkins@192.168.50.10 'nohup java -jar /opt/pet/spring-petclinic-1.5.1.jar &'"
}
}
}
}