@@ -12,6 +12,14 @@ metadata:
12
12
(!has(body.ref) || body.ref == 'refs/heads/main' || body.ref == 'refs/heads/dev') &&
13
13
(!has(body.head_commit) || !has(body.head_commit.author) || !body.head_commit.author.name.matches("(?i).*ci-tag-bot.*")) &&
14
14
(!has(body.pull_request) || (body.pull_request.base.ref == 'main' || body.pull_request.base.ref == 'dev'))
15
+ results.tekton.dev/columns : |
16
+ [
17
+ {
18
+ "name": "Vulnerabilities",
19
+ "type": "string",
20
+ "jsonPath": ".status.pipelineResults[?(@.name==\"vulnerabilities\")].value"
21
+ }
22
+ ]
15
23
spec :
16
24
podTemplate :
17
25
serviceAccountName : pipeline
@@ -58,31 +66,17 @@ spec:
58
66
- name : source
59
67
workspace : source
60
68
61
- # - name: debug-user
62
- # taskSpec:
63
- # workspaces:
64
- # - name: source
65
- # workspace: source
66
- # steps:
67
- # - name: show-user-info
68
- # image: busybox
69
- # script: |
70
- # #!/bin/sh
71
- # echo "Current UID:"
72
- # id -u
73
- # echo "Current GID:"
74
- # id -g
75
- # echo "Permissions on /workspace/source:"
76
- # ls -ld /workspace/source
77
- # workspaces:
78
- # - name: source
79
- # workspace: source
69
+ - name : read-cluster-name
70
+ taskRef :
71
+ name : read-cluster-name
72
+ runAfter :
73
+ - fix-permissions
80
74
81
75
- name : which-branch
82
76
taskRef :
83
77
name : print-branch-task
84
78
runAfter :
85
- - fix-permissions
79
+ - read-cluster-name
86
80
params :
87
81
- name : source-branch
88
82
value : " $(params.source_branch)"
@@ -113,6 +107,9 @@ spec:
113
107
- input : " $(params.runOptional)"
114
108
operator : in
115
109
values : ["true"]
110
+ - input : " $(tasks.read-cluster-name.results.cluster-name)"
111
+ operator : in
112
+ values : ["cluster-platform-eval"]
116
113
taskRef :
117
114
name : go-lint-task
118
115
runAfter :
@@ -126,11 +123,13 @@ spec:
126
123
- input : " $(params.runOptional)"
127
124
operator : in
128
125
values : ["true"]
126
+ - input : " $(tasks.read-cluster-name.results.cluster-name)"
127
+ operator : in
128
+ values : ["cluster-platform-eval"]
129
129
taskRef :
130
130
name : go-test-task
131
131
runAfter :
132
132
- go-lint
133
- # - fetch-repository
134
133
workspaces :
135
134
- name : source
136
135
workspace : source
@@ -140,6 +139,9 @@ spec:
140
139
- input : " $(params.runOptional)"
141
140
operator : in
142
141
values : ["true"]
142
+ - input : " $(tasks.read-cluster-name.results.cluster-name)"
143
+ operator : in
144
+ values : ["cluster-platform-eval"]
143
145
taskRef :
144
146
name : go-build-task
145
147
runAfter :
@@ -168,6 +170,9 @@ spec:
168
170
- input : " $(params.source_branch)"
169
171
operator : in
170
172
values : ["main"]
173
+ - input : " $(tasks.read-cluster-name.results.cluster-name)"
174
+ operator : in
175
+ values : ["cluster-platform-eval"]
171
176
taskRef :
172
177
name : promote-to-prod-task
173
178
params :
@@ -193,6 +198,9 @@ spec:
193
198
- input : " $(params.source_branch)"
194
199
operator : in
195
200
values : ["dev"]
201
+ - input : " $(tasks.read-cluster-name.results.cluster-name)"
202
+ operator : in
203
+ values : ["cluster-platform-eval"]
196
204
params :
197
205
- name : dev-version
198
206
value : " $(tasks.extract-version-and-registry.results.dev-version)"
@@ -210,10 +218,40 @@ spec:
210
218
- name : registry
211
219
workspace : registry-secret
212
220
221
+ - name : vulnerability-scan
222
+ when :
223
+ - input : " $(params.runOptional)"
224
+ operator : in
225
+ values : ["true"]
226
+ - input : " $(tasks.read-cluster-name.results.cluster-name)"
227
+ operator : in
228
+ values : ["cluster-platform-eval"]
229
+ runAfter :
230
+ - buildah-build
231
+ taskRef :
232
+ name : trivy-scan
233
+ params :
234
+ - name : IMAGE_URL
235
+ value : " $(tasks.buildah-build.results.image-url)"
236
+ - name : SEVERITY
237
+ value : " CRITICAL,HIGH"
238
+ - name : ARGS
239
+ value : " --exit-code 0"
240
+ workspaces :
241
+ - name : registry-secret
242
+ workspace : registry-secret
243
+ - name : output
244
+ workspace : output
245
+
213
246
- name : sync-after-promote-or-build
247
+ when :
248
+ - input : " $(tasks.read-cluster-name.results.cluster-name)"
249
+ operator : in
250
+ values : ["cluster-platform-eval"]
214
251
runAfter :
215
252
- promote-to-prod
216
- - buildah-build
253
+ # - buildah-build
254
+ - vulnerability-scan
217
255
taskRef :
218
256
name : noop-task
219
257
@@ -240,6 +278,9 @@ spec:
240
278
- input : " $(params.source_branch)"
241
279
operator : in
242
280
values : ["main", "dev"]
281
+ - input : " $(tasks.read-cluster-name.results.cluster-name)"
282
+ operator : in
283
+ values : ["cluster-platform-eval"]
243
284
taskRef :
244
285
name : tag-version-task
245
286
params :
@@ -310,12 +351,35 @@ spec:
310
351
workspaces :
311
352
- name : source
312
353
workspace : source
313
-
354
+
355
+ - name : benchmark
356
+ when :
357
+ - input : " $(params.source_branch)"
358
+ operator : in
359
+ values : ["dev"]
360
+ - input : " $(tasks.read-cluster-name.results.cluster-name)"
361
+ operator : in
362
+ values : ["cluster-platform-eval"]
363
+ continueOn :
364
+ errors : true
365
+ params :
366
+ - name : openshift_host
367
+ value : " https://api.fmaas-platform-eval.fmaas.res.ibm.com:6443"
368
+ - name : openshift_namespace
369
+ value : " hc4ai-operator-dev"
370
+ taskRef :
371
+ name : benchmark-task
372
+ runAfter :
373
+ - go-test-post-deploy
374
+
314
375
- name : increment-versions
315
376
when :
316
377
- input : " $(params.source_branch)"
317
378
operator : in
318
379
values : ["main"]
380
+ - input : " $(tasks.read-cluster-name.results.cluster-name)"
381
+ operator : in
382
+ values : ["cluster-platform-eval"]
319
383
params :
320
384
- name : source-branch
321
385
value : " $(params.source_branch)"
@@ -347,7 +411,7 @@ spec:
347
411
operator : in
348
412
values : ["dev"]
349
413
runAfter :
350
- - go-test-post-deploy
414
+ - benchmark
351
415
taskRef :
352
416
name : noop-task
353
417
@@ -360,6 +424,14 @@ spec:
360
424
resources :
361
425
requests :
362
426
storage : 1Gi
427
+ - name : output
428
+ volumeClaimTemplate :
429
+ spec :
430
+ accessModes :
431
+ - ReadWriteOnce
432
+ resources :
433
+ requests :
434
+ storage : 1Gi
363
435
- name : basic-auth
364
436
secret :
365
437
secretName : " {{ git_auth_secret }}"
0 commit comments