Skip to content
Snippets Groups Projects
Unverified Commit 2fac42fa authored by Timo Furrer's avatar Timo Furrer
Browse files

Archive images list for release

parent 6b4f5097
No related branches found
No related tags found
No related merge requests found
......@@ -110,10 +110,10 @@ gitlab-opentofu-image:deploy:with-opentofu-version:
- crane auth login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
script:
- crane copy "$GITLAB_OPENTOFU_IMAGE_NAME" "$RELEASE_IMAGE"
- 'echo "- \`$RELEASE_IMAGE\` (digest: \`$(crane digest $RELEASE_IMAGE)\`)" > image$CI_JOB_ID.txt'
- 'echo "- \`$RELEASE_IMAGE\` (digest: \`$(crane digest $RELEASE_IMAGE)\`)" > image$CI_JOB_ID.md'
artifacts:
paths:
- 'image*.txt'
- 'image*.md'
rules:
- if: $CI_COMMIT_TAG
......@@ -131,10 +131,10 @@ gitlab-opentofu-image:deploy:latest-with-opentofu-version:
- crane auth login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
script:
- crane copy "$GITLAB_OPENTOFU_IMAGE_NAME" "$RELEASE_IMAGE"
- 'echo "- \`$RELEASE_IMAGE\` (digest: \`$(crane digest $RELEASE_IMAGE)\`)" > image$CI_JOB_ID.txt'
- 'echo "- \`$RELEASE_IMAGE\` (digest: \`$(crane digest $RELEASE_IMAGE)\`)" > image$CI_JOB_ID.md'
artifacts:
paths:
- 'image*.txt'
- 'image*.md'
rules:
- if: $CI_COMMIT_TAG
......@@ -151,10 +151,10 @@ gitlab-opentofu-image:deploy:latest:
- crane auth login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
script:
- crane copy "$GITLAB_OPENTOFU_IMAGE_NAME" "$RELEASE_IMAGE"
- 'echo "- \`$RELEASE_IMAGE\` (digest: \`$(crane digest $RELEASE_IMAGE)\`)" > image$CI_JOB_ID.txt'
- 'echo "- \`$RELEASE_IMAGE\` (digest: \`$(crane digest $RELEASE_IMAGE)\`)" > image$CI_JOB_ID.md'
artifacts:
paths:
- 'image*.txt'
- 'image*.md'
rules:
- if: $CI_COMMIT_TAG
parallel:
......@@ -166,33 +166,24 @@ gitlab-opentofu-image:deploy:latest:
# If the pipeline is for a new tag with a semantic version, and all previous jobs succeed,
# create the release.
.create-release:
create-release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG =~ /\d+/
before_script:
- apk add --update yq envsubst
script:
- echo "Creating release $CI_COMMIT_TAG"
- AVAILABLE_OPENTOFU_VERSIONS=$(yq -r '.spec.inputs.opentofu_version.options | filter((. | test("\$.*")) == false) | .[] | "- [`" + . + "`](https://github.com/opentofu/opentofu/releases/tag/v" + . + ")"' templates/full-pipeline.yml)
- export AVAILABLE_OPENTOFU_VERSIONS
- cat image*.txt | sort
- 'AVAILABLE_IMAGES=$(cat image*.txt | sort | sed -E "s/(\(digest: .*\))/\n - \1/")'
- 'AVAILABLE_IMAGES=$(cat image*.md | sort | tee images.md | sed -E "s/(\(digest: .*\))/\n - \1/")'
- export AVAILABLE_IMAGES
- cat .gitlab/release-template.md | envsubst > release-notes.md
# create-release:dry-run:
# extends: .create-release
# script:
# - !reference [.create-release, script]
# - cat release-notes.md
# artifacts:
# paths:
# - release-notes.md
create-release:
extends: .create-release
rules:
- if: $CI_COMMIT_TAG =~ /\d+/
artifacts:
paths:
- images.md
- release-notes.md
release:
tag_name: $CI_COMMIT_TAG
description: './release-notes.md'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment