-
Notifications
You must be signed in to change notification settings - Fork 2
/
maximo-pipeline.yaml
186 lines (184 loc) · 5.17 KB
/
maximo-pipeline.yaml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: mas-core-deploy
namespace: default
spec:
workspaces:
- name: shared-workspace
params:
- name: namespace
type: string
default: "masauto-operator-system"
- name: operatorGroup
type: string
default: "masauto-operator-system-operator-group"
tasks:
- name: add-namespace
TaskRef:
kind: Task
name: ibm-pak
params:
- name: SCRIPT
value: |
oc apply -f - <<EOF
kind: Namespace
apiVersion: v1
metadata:
name: $(params.namespace)
EOF
- name: add-operator-group
taskRef:
kind: Task
name: ibm-pak
runAfter:
- add-namespace
params:
- name: SCRIPT
value: |
oc apply -f - <<EOF
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: $(params.operatorGroup)
namespace: $(params.namespace)
spec:
targetNamespaces:
- $(params.namespace)
EOF
- name: get-ibm-entitlement-key
taskRef:
name: ibmcloud-secrets-manager-get
kind: Task
params:
- name: KEY_ID
value: 968d7819-f2c5-7b67-c420-3c6bfd51521e
- name: SECRETS_MANAGER_ENDPOINT_URL
value: >-
https://afa20521-cd75-4864-843f-e59fd0ffd49d.us-south.secrets-manager.appdomain.cloud
- name: add-entitlement-key
taskRef:
kind: Task
name: ibm-pak
runAfter:
- get-ibm-entitlement-key
params:
- name: SCRIPT
value: |
oc apply -f - <<EOF
kind: Secret
apiVersion: v1
metadata:
name: ibm-entitlement-key
namespace: $(params.namespace)
type: Opaque
stringData:
password: $(tasks.get-ibm-entitlement-key.results.secret-value)
username: "cp"
EOF
sleep 10
- name: fetch-repository
taskRef:
resolver: hub
params:
- name: kind
value: task
- name: name
value: git-clone
- name: version
value: "0.9"
workspaces:
- name: output
workspace: shared-workspace
params:
- name: url
value: "https://github.com/cloud-native-toolkit/operator-masauto"
- name: revision
value: "main"
- name: add-catalog-source
taskRef:
kind: Task
name: ibm-pak
runAfter:
- add-entitlement-key
params:
- name: SCRIPT
value: |
oc apply -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: ecosystem-engineering-catalog
namespace: openshift-marketplace
labels:
app.kubernetes.io/name: ecosystem-engineering-catalog
app.kubernetes.io/instance: ecosystem-engineering-catalog
app.kubernetes.io/version: v0.16.0
spec:
displayName: ecosystem-engineering-catalog
publisher: IBM
sourceType: grpc
image: quay.io/cloudnativetoolkit/ecosysengineer-catalog:latest
updateStrategy:
registryPoll:
interval: 90m
EOF
sleep 10
- name: add-operator
taskRef:
kind: Task
name: ibm-pak
runAfter:
- add-catalog-source
- add-operator-group
params:
- name: SCRIPT
value: |
oc apply -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: masauto-operator
namespace: $(params.namespace)
labels:
app.kubernetes.io/name: masauto-operator
app.kubernetes.io/instance: masauto-operator
app.kubernetes.io/version: "1.16.0"
spec:
channel: alpha
installPlanApproval: Automatic
name: masauto-operator
source: ecosystem-engineering-catalog
sourceNamespace: openshift-marketplace
EOF
sleep 20
- name: add-mas-core
taskRef:
resolver: hub
params:
- name: name
value: helm-upgrade-from-source
- name: version
value: "0.3"
runAfter:
- fetch-repository
- add-operator
workspaces:
- name: source
workspace: shared-workspace
params:
- name: charts_dir
value: charts/mas-core
- name: values_file
value: ../values_mas_core.yaml
- name: wait-till-job-complete
taskRef:
kind: Task
name: ibm-pak
runAfter:
- add-mas-core
params:
- name: SCRIPT
value: |
oc wait --for=condition=available deployment/masauto-operator-controller-manager -n masauto-operator-system --insecure-skip-tls-verify 2>/dev/null