-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile.oc.s390x
48 lines (44 loc) · 1.57 KB
/
Jenkinsfile.oc.s390x
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
45
46
47
48
pipeline {
agent {
label 's390x'
}
environment {
git = 'https://github.com/pdfruth/temperature-converter.git'
oc_token = credentials('pdf-octoken-s390x')
pullSecret = credentials('pdf-pull-secret')
ocp_server = 'https://api.ocp1.ocp.local:6443'
app = 'temperature-converter'
}
stages {
stage('Create Project') {
steps {
sh 'oc login --token=$oc_token --insecure-skip-tls-verify --server=$ocp_server'
//sh 'oc delete namespace $app --wait=true || true'
//sh 'oc new-project java-hello-world'
//sh 'kubectl create -f $pullSecret -n=$app'
//sh 'oc secrets link builder 13358228-test19918811112-pull-secret -n=$app'
//sh 'oc secrets link default 13358228-test19918811112-pull-secret -n=$app'
}
}
stage('Build and deploy') {
steps {
sh 'oc project pdf-$app'
sh 'oc delete bc $app || true'
sh 'oc delete deployment $app || true'
sh 'oc delete service $app || true'
sh 'oc delete route $app || true'
sh 'oc new-app $git'
sh 'sleep 10'
sh 'oc logs -f bc/$app'
sh 'sleep 15'
}
}
stage('Expose Route') {
steps {
sh 'oc project pdf-$app'
sh 'oc expose svc/$app'
sh 'oc get routes -o json | jq -r \'.items[0].spec.host\''
}
}
}
}