Skip to content

Commit 27cc6fa

Browse files
authored
Add short commit to image tag (#229)
1 parent c1ba057 commit 27cc6fa

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.tekton/pipeline-build.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ spec:
6262
type: string
6363
default: ""
6464

65+
- name: tag-prefix
66+
description: Prefix added to additional tags
67+
type: string
68+
default: ""
69+
6570
results:
6671
- name: IMAGE_URL
6772
description: ""
@@ -361,6 +366,10 @@ spec:
361366
params:
362367
- name: IMAGE
363368
value: $(tasks.build-container.results.IMAGE_URL)
369+
370+
- name: ADDITIONAL_TAGS
371+
value:
372+
- $(params.tag-prefix)$(tasks.clone-repository.results.short-commit)
364373
runAfter:
365374
- build-container
366375
taskRef:
@@ -442,3 +451,4 @@ spec:
442451

443452
- name: kind
444453
value: task
454+

.tekton/pull_request.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ spec:
2727
value: '{{ revision }}'
2828

2929
- name: output-image
30-
value: quay.io/redhat-user-workloads/cost-mgmt-dev-tenant/koku-daily:pr-{{ pull_request_number }}
30+
value: quay.io/redhat-user-workloads/cost-mgmt-dev-tenant/koku-daily:pr-{{ pull_request_number }}-latest
3131

3232
- name: image-expires-after
3333
value: 5d
@@ -38,6 +38,9 @@ spec:
3838
- name: path-context
3939
value: .
4040

41+
- name: tag-prefix
42+
value: pr-{{ pull_request_number }}-
43+
4144
pipelineRef:
4245
name: pipeline-build
4346

0 commit comments

Comments
 (0)