forked from jamesfalkner/microsweeper-demo
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
44 lines (44 loc) · 1.26 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
39
40
41
42
43
44
pipeline {
agent {
label 'maven'
}
stages {
stage('Run Tests') {
steps {
sh "cp .settings.xml ~/.m2/settings.xml"
sh "echo done"
}
}
stage('Build App') {
steps {
sh "cp .settings.xml ~/.m2/settings.xml"
sh "mvn clean package -Popenshift -DskipTests"
}
}
stage('Build Container') {
steps {
script {
openshift.withCluster() {
openshift.startBuild("microsweeper", "--from-file=target/demo-thorntail.jar", "--wait")
}
}
}
}
stage('Deploy to Prod') {
steps {
script {
openshift.withCluster() {
def result, dc = openshift.selector("dc", "microsweeper")
dc.rollout().latest()
timeout(10) {
result = dc.rollout().status("-w")
}
if (result.status != 0) {
error(result.err)
}
}
}
}
}
}
}