Skip to content

Commit

Permalink
Add short commit to image tag (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
samdoran authored Nov 13, 2024
1 parent 1bfce4e commit b5edbb6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .tekton/pipeline-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ spec:
type: string
default: ""

- name: tag-prefix
description: Prefix added to additional tags
type: string
default: ""

results:
- name: IMAGE_URL
description: ""
Expand Down Expand Up @@ -361,6 +366,10 @@ spec:
params:
- name: IMAGE
value: $(tasks.build-container.results.IMAGE_URL)

- name: ADDITIONAL_TAGS
value:
- $(params.tag-prefix)$(tasks.clone-repository.results.short-commit)
runAfter:
- build-container
taskRef:
Expand Down
5 changes: 4 additions & 1 deletion .tekton/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
value: '{{revision}}'

- name: output-image
value: quay.io/redhat-user-workloads/cost-mgmt-dev-tenant/koku-report-emailer:pr-{{ pull_request_number }}
value: quay.io/redhat-user-workloads/cost-mgmt-dev-tenant/koku-report-emailer:pr-{{ pull_request_number }}-latest

- name: image-expires-after
value: 5d
Expand All @@ -38,6 +38,9 @@ spec:
- name: path-context
value: .

- name: tag-prefix
value: pr-{{ pull_request_number }}-

pipelineRef:
name: pipeline-build

Expand Down

0 comments on commit b5edbb6

Please sign in to comment.