Skip to content

Commit c9e8a94

Browse files
mabulgujameswnl
authored andcommitted
implement the push pipeline
1 parent cf89034 commit c9e8a94

File tree

1 file changed

+103
-71
lines changed

1 file changed

+103
-71
lines changed

.tekton/ansible-chatbot-service-push.yaml

Lines changed: 103 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,32 @@ apiVersion: tekton.dev/v1
22
kind: PipelineRun
33
metadata:
44
annotations:
5-
build.appstudio.openshift.io/repo: https://github.com/openshift/lightspeed-service?rev={{revision}}
6-
build.appstudio.redhat.com/commit_sha: "{{revision}}"
7-
build.appstudio.redhat.com/target_branch: "{{target_branch}}"
5+
build.appstudio.openshift.io/repo: https://github.com/ansible/ansible-chatbot-service?rev={{revision}}
6+
build.appstudio.redhat.com/commit_sha: '{{revision}}'
7+
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
88
pipelinesascode.tekton.dev/max-keep-runs: "3"
9-
pipelinesascode.tekton.dev/on-cel-expression: "event == \"push\" && \ntarget_branch == \"main\"\n"
9+
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch == "main"
1010
build.appstudio.openshift.io/build-nudge-files: |
1111
.*Dockerfile.*, bundle/manifests/lightspeed-operator.clusterserviceversion.yaml, config/default/kustomization.yaml, lightspeed-catalog-4.15/index.yaml, lightspeed-catalog-4.16/index.yaml
1212
creationTimestamp: null
1313
labels:
14-
appstudio.openshift.io/application: ols
15-
appstudio.openshift.io/component: lightspeed-service
14+
appstudio.openshift.io/application: ansible-chatbot-service
15+
appstudio.openshift.io/component: ansible-chatbot-service
1616
pipelines.appstudio.openshift.io/type: build
17-
name: lightspeed-service-on-push
18-
namespace: crt-nshift-lightspeed-tenant
17+
name: ansible-chatbot-service-on-push
18+
namespace: ansible-lightspeed-tenant
1919
spec:
2020
params:
2121
- name: dockerfile
2222
value: Containerfile
2323
- name: git-url
2424
value: "{{source_url}}"
2525
- name: output-image
26-
value: quay.io/redhat-user-workloads/crt-nshift-lightspeed-tenant/ols/lightspeed-service:{{revision}}
26+
value: quay.io/ansible/ansible-chatbot-service:{{revision}}
2727
- name: path-context
2828
value: .
2929
- name: revision
3030
value: "{{revision}}"
31-
- name: build-source-image
32-
value: "true"
33-
- name: prefetch-input
34-
value: '[{"type": "rpm", "path": "."}, {"type": "pip", "path": ".", "allow_binary": "true"}]'
35-
- name: hermetic
36-
value: "true"
37-
taskRunSpecs:
38-
- pipelineTaskName: build-source-image
39-
computeResources:
40-
requests:
41-
cpu: '1'
42-
memory: 1Gi
43-
limits:
44-
memory: 4Gi
45-
- pipelineTaskName: clair-scan
46-
computeResources:
47-
requests:
48-
cpu: '1'
49-
memory: 1Gi
50-
limits:
51-
memory: 8Gi
52-
- pipelineTaskName: ecosystem-cert-preflight-checks
53-
computeResources:
54-
requests:
55-
cpu: '1'
56-
memory: 1Gi
57-
limits:
58-
memory: 8Gi
5931
pipelineSpec:
6032
finally:
6133
- name: show-sbom
@@ -67,7 +39,7 @@ spec:
6739
- name: name
6840
value: show-sbom
6941
- name: bundle
70-
value: quay.io/konflux-ci/tekton-catalog/task-show-sbom:0.1@sha256:9bfc6b99ef038800fe131d7b45ff3cd4da3a415dd536f7c657b3527b01c4a13b
42+
value: quay.io/redhat-appstudio-tekton-catalog/task-show-sbom:0.1@sha256:8e0f8cad75e6f674d72a874385b69c4651afc0c9dcc59feffe0d85844687d852
7143
- name: kind
7244
value: task
7345
resolver: bundles
@@ -93,6 +65,44 @@ spec:
9365
workspaces:
9466
- name: workspace
9567
workspace: workspace
68+
- name: slack-notification-when-failed
69+
params:
70+
- name: message
71+
value: Konflux https://console.redhat.com/application-pipeline/workspaces/ansible-lightspeed/applications/ansible-chatbot-service/pipelineruns/$(context.pipelineRun.name) status=$(tasks.status)
72+
- name: secret-name
73+
value: slack-webhook-urls
74+
- name: key-name
75+
value: team-wisdom-eng
76+
taskRef:
77+
params:
78+
- name: bundle
79+
value: quay.io/redhat-appstudio-tekton-catalog/task-slack-webhook-notification:0.1
80+
- name: name
81+
value: slack-webhook-notification
82+
- name: kind
83+
value: Task
84+
resolver: bundles
85+
when:
86+
- input: $(tasks.status)
87+
operator: in
88+
values: [ "Failed" ]
89+
- name: slack-notification
90+
params:
91+
- name: message
92+
value: Konflux https://console.redhat.com/application-pipeline/workspaces/ansible-lightspeed/applications/ansible-chatbot-service/pipelineruns/$(context.pipelineRun.name) status=$(tasks.status)
93+
- name: secret-name
94+
value: slack-webhook-urls
95+
- name: key-name
96+
value: wisdom-cicd-events
97+
taskRef:
98+
params:
99+
- name: bundle
100+
value: quay.io/redhat-appstudio-tekton-catalog/task-slack-webhook-notification:0.1
101+
- name: name
102+
value: slack-webhook-notification
103+
- name: kind
104+
value: Task
105+
resolver: bundles
96106
params:
97107
- description: Source Repository URL
98108
name: git-url
@@ -139,10 +149,6 @@ spec:
139149
description: Build a source image.
140150
name: build-source-image
141151
type: string
142-
- default: []
143-
description: Array of --build-arg values ("arg=value" strings) for buildah
144-
name: build-args
145-
type: array
146152
- default: ""
147153
description: Path to a file with build arguments for buildah, see https://www.mankier.com/1/buildah-build#--build-arg-file
148154
name: build-args-file
@@ -177,7 +183,7 @@ spec:
177183
- name: name
178184
value: init
179185
- name: bundle
180-
value: quay.io/konflux-ci/tekton-catalog/task-init:0.2@sha256:092c113b614f6551113f17605ae9cb7e822aa704d07f0e37ed209da23ce392cc
186+
value: quay.io/redhat-appstudio-tekton-catalog/task-init:0.2@sha256:596b7c11572bb94eb67d9ffb4375068426e2a8249ff2792ce04ad2a4bc593a63
181187
- name: kind
182188
value: task
183189
resolver: bundles
@@ -194,7 +200,7 @@ spec:
194200
- name: name
195201
value: git-clone
196202
- name: bundle
197-
value: quay.io/konflux-ci/tekton-catalog/task-git-clone:0.1@sha256:2cccdf8729ad4d5adf65e8b66464f8efa1e1c87ba16d343b4a6c621a2a40f7e1
203+
value: quay.io/redhat-appstudio-tekton-catalog/task-git-clone:0.1@sha256:9e6c4db5a666ea0e1e747e03d63f46e5617a6b9852c26871f9d50891d778dfa2
198204
- name: kind
199205
value: task
200206
resolver: bundles
@@ -221,7 +227,7 @@ spec:
221227
- name: name
222228
value: prefetch-dependencies
223229
- name: bundle
224-
value: quay.io/konflux-ci/tekton-catalog/task-prefetch-dependencies:0.1@sha256:fe7234e3824d1e65d6a7aac352e7a6bbce623d90d8d7da9aceeee108ad2c61be
230+
value: quay.io/redhat-appstudio-tekton-catalog/task-prefetch-dependencies:0.1@sha256:eea8bd511343b4014dab46a77e7215510f7a63820937d1267c6dc428e10ffbe4
225231
- name: kind
226232
value: task
227233
resolver: bundles
@@ -230,6 +236,10 @@ spec:
230236
operator: notin
231237
values:
232238
- ""
239+
- input: $(params.hermetic)
240+
operator: in
241+
values:
242+
- "true"
233243
workspaces:
234244
- name: source
235245
workspace: workspace
@@ -251,19 +261,20 @@ spec:
251261
value: $(params.image-expires-after)
252262
- name: COMMIT_SHA
253263
value: $(tasks.clone-repository.results.commit)
254-
- name: BUILD_ARGS
255-
value:
256-
- $(params.build-args[*])
257264
- name: BUILD_ARGS_FILE
258-
value: build.args
265+
value: $(params.build-args-file)
266+
- name: TARGET_STAGE
267+
value: production
268+
- name: BUILD_ARGS
269+
value: [ "IMAGE_TAGS=latest 1.0.$(tasks.git-metadata.results.commit-timestamp)", "GIT_COMMIT=$(tasks.clone-repository.results.commit)" ]
259270
runAfter:
260271
- prefetch-dependencies
261272
taskRef:
262273
params:
263274
- name: name
264275
value: buildah-10gb
265276
- name: bundle
266-
value: quay.io/konflux-ci/tekton-catalog/task-buildah-10gb:0.2@sha256:fe86b7c7e746f0d0a5ee6791d29eae5569138a5d31df42fadebcb6a9d2722ccb
277+
value: quay.io/redhat-appstudio-tekton-catalog/task-buildah-10gb:0.2
267278
- name: kind
268279
value: task
269280
resolver: bundles
@@ -275,6 +286,42 @@ spec:
275286
workspaces:
276287
- name: source
277288
workspace: workspace
289+
- name: apply-tags
290+
params:
291+
- name: IMAGE
292+
value: $(tasks.build-container.results.IMAGE_URL)
293+
- name: ADDITIONAL_TAGS
294+
value: [ "latest", "1.0.$(tasks.git-metadata.results.commit-timestamp)" ]
295+
runAfter:
296+
- build-container
297+
taskRef:
298+
params:
299+
- name: name
300+
value: apply-tags
301+
- name: bundle
302+
value: quay.io/redhat-appstudio-tekton-catalog/task-apply-tags:0.1
303+
- name: kind
304+
value: task
305+
resolver: bundles
306+
- name: git-metadata
307+
runAfter:
308+
- clone-repository
309+
workspaces:
310+
- name: source
311+
workspace: workspace
312+
taskSpec:
313+
workspaces:
314+
- name: source
315+
steps:
316+
- name: get-commit-timestamp
317+
image: alpine/git
318+
script: |
319+
#!/bin/sh
320+
set -euo pipefail
321+
cd "$(workspaces.source.path)/source"
322+
echo -n $(date -d @$(git log -1 --format=%at) "+%Y%m%d%H%M") > $(results.commit-timestamp.path)
323+
results:
324+
- name: commit-timestamp
278325
- name: build-source-image
279326
params:
280327
- name: BINARY_IMAGE
@@ -286,7 +333,7 @@ spec:
286333
- name: name
287334
value: source-build
288335
- name: bundle
289-
value: quay.io/konflux-ci/tekton-catalog/task-source-build:0.1@sha256:21cb5ebaff7a9216903cf78933dc4ec4dd6283a52636b16590a5f52ceb278269
336+
value: quay.io/redhat-appstudio-tekton-catalog/task-source-build:0.1@sha256:14b91ad9124b722b44222685013faaf9af8ac5b66030d9abeb1c61da3c118cdd
290337
- name: kind
291338
value: task
292339
resolver: bundles
@@ -315,7 +362,7 @@ spec:
315362
- name: name
316363
value: deprecated-image-check
317364
- name: bundle
318-
value: quay.io/konflux-ci/tekton-catalog/task-deprecated-image-check:0.4@sha256:b4f9599f5770ea2e6e4d031224ccc932164c1ecde7f85f68e16e99c98d754003
365+
value: quay.io/redhat-appstudio-tekton-catalog/task-deprecated-image-check:0.4@sha256:1f17ef7ab9859d6e2215ef2ed532ebc15e516ba09226b8cae77907a7a8b7cedd
319366
- name: kind
320367
value: task
321368
resolver: bundles
@@ -337,7 +384,7 @@ spec:
337384
- name: name
338385
value: clair-scan
339386
- name: bundle
340-
value: quay.io/konflux-ci/tekton-catalog/task-clair-scan:0.2@sha256:28fee4bf5da87f2388c973d9336086749cad8436003f9a514e22ac99735e056b
387+
value: quay.io/redhat-appstudio-tekton-catalog/task-clair-scan:0.1@sha256:b8c51079ea1110e1095c229e184e3c340120ba211a63a200e836706f5a35361c
341388
- name: kind
342389
value: task
343390
resolver: bundles
@@ -357,7 +404,7 @@ spec:
357404
- name: name
358405
value: ecosystem-cert-preflight-checks
359406
- name: bundle
360-
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.1@sha256:5131cce0f93d0b728c7bcc0d6cee4c61d4c9f67c6d619c627e41e3c9775b497d
407+
value: quay.io/redhat-appstudio-tekton-catalog/task-ecosystem-cert-preflight-checks:0.1@sha256:fc2cda064580364bb80c3ad6f438002de0033963fc33985d01ad249346b93433
361408
- name: kind
362409
value: task
363410
resolver: bundles
@@ -374,7 +421,7 @@ spec:
374421
- name: name
375422
value: sast-snyk-check
376423
- name: bundle
377-
value: quay.io/konflux-ci/tekton-catalog/task-sast-snyk-check:0.2@sha256:c1ea706405f9ae146e31baef4abfea49b1e855a75bfc44c33eb0eb29516831b3
424+
value: quay.io/redhat-appstudio-tekton-catalog/task-sast-snyk-check:0.2@sha256:479bd0d9aaa7b377ff5f8ad93168d44807455646f2161688637cb2e4e0b990d9
378425
- name: kind
379426
value: task
380427
resolver: bundles
@@ -404,7 +451,7 @@ spec:
404451
- name: name
405452
value: clamav-scan
406453
- name: bundle
407-
value: quay.io/konflux-ci/tekton-catalog/task-clamav-scan:0.1@sha256:1e29eebe916b81b7100138d62db0e03e22d03657274d37041c59cbaca5fdbf7d
454+
value: quay.io/konflux-ci/tekton-catalog/task-clamav-scan:0.1@sha256:7bb17b937c9342f305468e8a6d0a22493e3ecde58977bd2ffc8b50e2fa234d58
408455
- name: kind
409456
value: task
410457
resolver: bundles
@@ -413,21 +460,6 @@ spec:
413460
operator: in
414461
values:
415462
- "false"
416-
- name: apply-tags
417-
params:
418-
- name: IMAGE
419-
value: $(tasks.build-container.results.IMAGE_URL)
420-
runAfter:
421-
- build-container
422-
taskRef:
423-
params:
424-
- name: name
425-
value: apply-tags
426-
- name: bundle
427-
value: quay.io/konflux-ci/tekton-catalog/task-apply-tags:0.1@sha256:f485e250fb060060892b633c495a3d7e38de1ec105ae1be48608b0401530ab2c
428-
- name: kind
429-
value: task
430-
resolver: bundles
431463
workspaces:
432464
- name: workspace
433465
- name: git-auth

0 commit comments

Comments
 (0)