Repository navigation
Expand file tree
/
Copy pathJenkinsfile
More file actions
57 lines (49 loc) · 2.02 KB
/
Copy pathJenkinsfile
File metadata and controls
57 lines (49 loc) · 2.02 KB
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
49
50
51
52
53
54
55
56
57
// name of the template that will be created
def templateName = 'wm-msr-runtime'
pipeline {
agent none
stages {
stage('Initialize Products'){
steps {
script {
openshift.withCluster() {
def dcProduccts = openshift.newApp( 'https://github.com/elpinjo/api-first-workshop.git', '--context-dir=Products', '--name=products' ).narrow('dc')
def dc = dcProduccts.object()
// dc is not a Selector -- It is a Groovy Map which models the content of the DC
// new-app created at the time object() was called. Changes to the model are not
// reflected back to the API server, but the DC's content is at our fingertips.
echo "new-app created a ${dc.kind} with name ${dc.metadata.name}"
echo "The object has labels: ${dc.metadata.labels}"
}
}
}
}
stage('Initialize Machines'){
steps {
script {
openshift.withCluster() {
def dcMachines = openshift.newApp( 'https://github.com/elpinjo/api-first-workshop.git', '--context-dir=Machines', '--name=machines' ).narrow('dc')
def dc = dcMachines.object()
echo "new-app created a ${dc.kind} with name ${dc.metadata.name}"
echo "The object has labels: ${dc.metadata.labels}"
}
}
}
}
stage('Initialize Service Monitor'){
steps {
script {
openshift.withCluster() {
def dcServiceMonitor = openshift.newApp( 'https://github.com/elpinjo/api-first-workshop.git', '--context-dir=ServiceMonitor', '--name=serviceMonitor' ).narrow('dc')
def dc = dcServiceMonitor.object()
// dc is not a Selector -- It is a Groovy Map which models the content of the DC
// new-app created at the time object() was called. Changes to the model are not
// reflected back to the API server, but the DC's content is at our fingertips.
echo "new-app created a ${dc.kind} with name ${dc.metadata.name}"
echo "The object has labels: ${dc.metadata.labels}"
}
}
}
}
}
}