-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
38 lines (38 loc) · 1.01 KB
/
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
26
27
28
29
30
31
32
33
34
35
36
37
38
pipeline {
agent any
tools {
maven 'Apache Maven 3.5.2'
}
stages{
stage('Checkout') {
steps {
git 'https://github.com/vyjorg/LPDM-Zuul-Server'
}
}
stage('Tests') {
steps {
sh 'mvn clean test'
}
post {
always {
junit 'target/surefire-reports/**/*.xml'
}
failure {
error 'The tests failed'
}
}
}
stage('Push to DockerHub') {
steps {
sh 'mvn clean package'
}
}
stage('Deploy') {
steps {
sh 'docker stop LPDM-ZuulMS || true && docker rm LPDM-ZuulMS || true'
sh 'docker pull vyjorg/lpdm-zuul:latest'
sh 'docker run -d --name LPDM-ZuulMS -p 28090:28090 --restart always --memory-swappiness=0 vyjorg/lpdm-zuul:latest'
}
}
}
}