opendevstack / ods-pipeline-image

ODS Pipeline tasks for container image packaging
Apache License 2.0
0 stars 0 forks source link

Publish full image ref as result #9

Closed michaelsauter closed 7 months ago

michaelsauter commented 8 months ago

Right now only the digest is published. It would be nice to publish the image ref (including registry, image stream, etc.) to make use of it in other tasks. For example, one could have a separate task which signs the image (although signing could/should likely also be part of this task):

- name: sign
  runAfter:
    - package
  taskSpec:
    params:
      - { name: image-ref, type: 'string' }
    steps:
      - name: sign
        image: cgr.dev/chainguard/cosign
        imagePullPolicy: IfNotPresent
        script: |
          cosign sign --tlog-upload=false --key k8s://<namespace>/<secret> $(params.image-ref)
  params:
    - { name: image-ref, value: '$(tasks.package.results.image-ref)' }