-
Notifications
You must be signed in to change notification settings - Fork 8
/
Jenkinsfile
44 lines (44 loc) · 882 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
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('Build JAR') {
steps {
sh "mvn -B -DskipTests clean package"
stash name:"jar", includes:"target/hello-0.0.1-SNAPSHOT.jar"
}
}
stage('Test') {
steps {
sh 'mvn test'
}
post {
always {
junit 'target/surefire-reports/*.xml'
}
}
}
stage('Build Image') {
steps {
unstash name:"jar"
script {
openshift.withCluster() {
openshift.startBuild("hello", "--from-file=target/hello-0.0.1-SNAPSHOT.jar", "--wait")
}
}
}
}
stage('Deploy') {
steps {
script {
openshift.withCluster() {
def dc = openshift.selector("dc", "hello")
dc.rollout().latest()
dc.rollout().status()
}
}
}
}
}
}