Skip to content

Commit

Permalink
Add OCI source label to images
Browse files Browse the repository at this point in the history
When building images with ko, add the OCI source label:

org.opencontainers.image.source=https://$(params.package)

This is generally useful, and in the case of ghcr.io it
lets GitHub automatically associated the container image
with its source repository.

Signed-off-by: Andrea Frittoli <[email protected]>
  • Loading branch information
afrittoli authored and tekton-robot committed Sep 9, 2024
1 parent 4759ab2 commit 2bbd219
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tekton/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ spec:
# Publish images and create release.notags.yaml
# This is useful if your container runtime doesn't support the `image-reference:tag@digest` notation
# This is currently the case for `cri-o` (and most likely others)
ko resolve --platform=$(params.platforms) --preserve-import-paths -R -f ${PROJECT_ROOT}/config/ > $OUTPUT_RELEASE_DIR/release.notags.yaml
ko resolve \
--image-label=org.opencontainers.image.source=https://$(params.package) \
--platform=$(params.platforms) \
--preserve-import-paths \
-R -f ${PROJECT_ROOT}/config/ > $OUTPUT_RELEASE_DIR/release.notags.yaml
# Rewrite "devel" to params.versionTag
sed -i -e 's/\(pipeline.tekton.dev\/release\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\(app.kubernetes.io\/version\): "devel"/\1: "$(params.versionTag)"/g' -e 's/\(version\): "devel"/\1: "$(params.versionTag)"/g' ${OUTPUT_RELEASE_DIR}/release.yaml
Expand Down

0 comments on commit 2bbd219

Please sign in to comment.