diff --git a/task/summary/0.1/summary.yaml b/task/summary/0.1/summary.yaml index b9e95db9ec..7093d1dde3 100644 --- a/task/summary/0.1/summary.yaml +++ b/task/summary/0.1/summary.yaml @@ -21,13 +21,9 @@ spec: description: State of build task in pipelineRun # Default Succeeded for backward compatibility default: Succeeded - workspaces: - - name: workspace - description: The workspace where source code is included. - optional: true steps: - name: appstudio-summary - image: quay.io/redhat-appstudio/task-toolset@sha256:931a9f7886586391ccb38d33fd15a47eb03568f9b19512b0a57a56384fa52a3c + image: registry.access.redhat.com/ubi9/ubi-minimal:9.3-1552@sha256:06d06f15f7b641a78f2512c8817cbecaa1bf549488e273f5ac27ff1654ed33f0 # per https://kubernetes.io/docs/concepts/containers/images/#imagepullpolicy-defaulting # the cluster will set imagePullPolicy to IfNotPresent # also per direction from Ralph Bean, we want to use image digest based tags to use a cue to automation like dependabot or renovatebot to periodially submit pull requests that update the digest as new images are released. @@ -40,8 +36,6 @@ spec: value: $(params.pipelinerun-name) - name: BUILD_TASK_STATUS value: $(params.build-task-status) - - name: SOURCE_BUILD_RESULT_FILE - value: "$(workspaces.workspace.path)/source_build_result.json" script: | #!/usr/bin/env bash echo @@ -51,9 +45,5 @@ spec: if [ "$BUILD_TASK_STATUS" == "Succeeded" ]; then echo "Generated Image is in : $IMAGE_URL" fi - if [ -e "$SOURCE_BUILD_RESULT_FILE" ]; then - url=$(jq -r ".image_url" <"$SOURCE_BUILD_RESULT_FILE") - echo "Generated Source Image is in : $url" - fi echo echo End Summary diff --git a/task/summary/0.2/MIGRATION.md b/task/summary/0.2/MIGRATION.md new file mode 100644 index 0000000000..b699b0bf8d --- /dev/null +++ b/task/summary/0.2/MIGRATION.md @@ -0,0 +1,17 @@ +# Migration from 0.1 to 0.2 + +Task `summary` can be optionally mounted to the shared workspace in order to show source container image URL. Apply the following diff to task `show-summary` in the PipelineRun YAMLs generated by Konflux bot. + +```diff + value: $(params.output-image) + - name: build-task-status + value: $(tasks.build-container.status) ++ workspaces: ++ - name: workspace ++ workspace: workspace + results: + - name: IMAGE_URL + value: "$(tasks.build-container.results.IMAGE_URL)" +``` + +This update to the PipelineRun is optional. The build pipeline can run normally without the mount. diff --git a/task/summary/0.2/README.md b/task/summary/0.2/README.md new file mode 100644 index 0000000000..9473cd76fc --- /dev/null +++ b/task/summary/0.2/README.md @@ -0,0 +1,16 @@ +# summary task + +Summary Pipeline Task. Prints PipelineRun information, removes image repository secret used by the PipelineRun. + +## Parameters +|name|description|default value|required| +|---|---|---|---| +|pipelinerun-name|pipeline-run to annotate||true| +|git-url|Git URL||true| +|image-url|Image URL||true| +|build-task-status|State of build task in pipelineRun|Succeeded|false| + +## Workspaces +|name|description|optional| +|---|---|---| +|workspace|The workspace where source code is included.|true| diff --git a/task/summary/0.2/summary.yaml b/task/summary/0.2/summary.yaml new file mode 100644 index 0000000000..b9e95db9ec --- /dev/null +++ b/task/summary/0.2/summary.yaml @@ -0,0 +1,59 @@ +apiVersion: tekton.dev/v1 +kind: Task +metadata: + labels: + app.kubernetes.io/version: "0.1" + annotations: + tekton.dev/pipelines.minVersion: "0.12.1" + tekton.dev/tags: "appstudio, hacbs" + name: summary +spec: + description: >- + Summary Pipeline Task. Prints PipelineRun information, removes image repository secret used by the PipelineRun. + params: + - name: pipelinerun-name + description: pipeline-run to annotate + - name: git-url + description: Git URL + - name: image-url + description: Image URL + - name: build-task-status + description: State of build task in pipelineRun + # Default Succeeded for backward compatibility + default: Succeeded + workspaces: + - name: workspace + description: The workspace where source code is included. + optional: true + steps: + - name: appstudio-summary + image: quay.io/redhat-appstudio/task-toolset@sha256:931a9f7886586391ccb38d33fd15a47eb03568f9b19512b0a57a56384fa52a3c + # per https://kubernetes.io/docs/concepts/containers/images/#imagepullpolicy-defaulting + # the cluster will set imagePullPolicy to IfNotPresent + # also per direction from Ralph Bean, we want to use image digest based tags to use a cue to automation like dependabot or renovatebot to periodially submit pull requests that update the digest as new images are released. + env: + - name: GIT_URL + value: $(params.git-url) + - name: IMAGE_URL + value: $(params.image-url) + - name: PIPELINERUN_NAME + value: $(params.pipelinerun-name) + - name: BUILD_TASK_STATUS + value: $(params.build-task-status) + - name: SOURCE_BUILD_RESULT_FILE + value: "$(workspaces.workspace.path)/source_build_result.json" + script: | + #!/usr/bin/env bash + echo + echo "Build Summary:" + echo + echo "Build repository: $GIT_URL" + if [ "$BUILD_TASK_STATUS" == "Succeeded" ]; then + echo "Generated Image is in : $IMAGE_URL" + fi + if [ -e "$SOURCE_BUILD_RESULT_FILE" ]; then + url=$(jq -r ".image_url" <"$SOURCE_BUILD_RESULT_FILE") + echo "Generated Source Image is in : $url" + fi + echo + echo End Summary