diff --git a/task/push-build-file-oci-ta/0.1/README.md b/task/push-build-file-oci-ta/0.1/README.md index 505fc7ed46..eb316c814f 100644 --- a/task/push-build-file-oci-ta/0.1/README.md +++ b/task/push-build-file-oci-ta/0.1/README.md @@ -13,3 +13,8 @@ Discover build file from source code and push it to registry as an OCI artifact. |SOURCE_ARTIFACT|The Trusted Artifact URI pointing to the artifact with the application source code.||true| |TAG_SUFFIX|Suffix of the build file image tag.|.dockerfile|false| +## Results +|name|description| +|---|---| +|IMAGE_URL|Digest-pinned image URL.| + diff --git a/task/push-build-file-oci-ta/0.1/push-build-file-oci-ta.yaml b/task/push-build-file-oci-ta/0.1/push-build-file-oci-ta.yaml index 8bba458c37..e3abb03fc9 100644 --- a/task/push-build-file-oci-ta/0.1/push-build-file-oci-ta.yaml +++ b/task/push-build-file-oci-ta/0.1/push-build-file-oci-ta.yaml @@ -42,6 +42,9 @@ spec: description: Suffix of the build file image tag. type: string default: .dockerfile + results: + - name: IMAGE_URL + description: Digest-pinned image URL. volumes: - name: workdir emptyDir: {} @@ -70,6 +73,8 @@ spec: value: $(params.CONTEXT) - name: ARTIFACT_TYPE value: $(params.ARTIFACT_TYPE) + - name: IMAGE_URL_RESULT + value: $(results.IMAGE_URL.path) script: | # Same discovery logic used in buildah task SOURCE_CODE_DIR=source @@ -98,6 +103,8 @@ spec: cd "$(dirname $build_file_path)" retry oras push --no-tty \ + --format json \ --registry-config "$auth_json" \ --artifact-type "$ARTIFACT_TYPE" \ - "$build_file_image" "$(basename $build_file_path)" + "$build_file_image" "$(basename $build_file_path)" | + yq '.reference' >"$IMAGE_URL_RESULT" diff --git a/task/push-build-file/0.1/README.md b/task/push-build-file/0.1/README.md index b0e54add19..2bbe30b65d 100644 --- a/task/push-build-file/0.1/README.md +++ b/task/push-build-file/0.1/README.md @@ -12,6 +12,11 @@ Discover build file from source code and push it to registry as an OCI artifact. |TAG_SUFFIX|Suffix of the build file image tag.|.dockerfile|false| |ARTIFACT_TYPE|Artifact type of the build file image.|application/vnd.konflux.dockerfile|false| +## Results +|name|description| +|---|---| +|IMAGE_URL|Digest-pinned image URL.| + ## Workspaces |name|description|optional| |---|---|---| diff --git a/task/push-build-file/0.1/push-build-file.yaml b/task/push-build-file/0.1/push-build-file.yaml index aa0f99d018..c2f96d3938 100644 --- a/task/push-build-file/0.1/push-build-file.yaml +++ b/task/push-build-file/0.1/push-build-file.yaml @@ -34,6 +34,9 @@ spec: description: Artifact type of the build file image. type: string default: application/vnd.konflux.dockerfile + results: + - name: IMAGE_URL + description: Digest-pinned image URL. steps: - name: push image: quay.io/konflux-ci/oras@sha256:5d0a8a5535fcc4ba467264cacbdeab2fb8662a538a61cb7fc8b3155e3f20fa39 @@ -51,6 +54,8 @@ spec: value: $(params.CONTEXT) - name: ARTIFACT_TYPE value: $(params.ARTIFACT_TYPE) + - name: IMAGE_URL_RESULT + value: $(results.IMAGE_URL.path) script: | # Same discovery logic used in buildah task SOURCE_CODE_DIR=source @@ -79,9 +84,11 @@ spec: cd "$(dirname $build_file_path)" retry oras push --no-tty \ + --format json \ --registry-config "$auth_json" \ --artifact-type "$ARTIFACT_TYPE" \ - "$build_file_image" "$(basename $build_file_path)" + "$build_file_image" "$(basename $build_file_path)" \ + | yq '.reference' >"$IMAGE_URL_RESULT" workspaces: - name: workspace