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

Note built images in release notes

parent 99bc57dc
No related branches found
No related tags found
No related merge requests found
......@@ -105,10 +105,15 @@ gitlab-opentofu-image:deploy:with-opentofu-version:
# We use a dash `-` here, instead of the `+`.
# This may be problematic, because it indicates a semver prerelease.
RELEASE_SEMVER: "${CI_COMMIT_TAG}-opentofu${OPENTOFU_VERSION}"
RELEASE_IMAGE: "$RELEASE_IMAGE_NAME:$RELEASE_SEMVER"
before_script:
- crane auth login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
script:
- crane copy "$GITLAB_OPENTOFU_IMAGE_NAME" "$RELEASE_IMAGE_NAME:$RELEASE_SEMVER"
- crane copy "$GITLAB_OPENTOFU_IMAGE_NAME" "$RELEASE_IMAGE"
- echo "- $RELEASE_IMAGE" > image$CI_JOB_ID.txt
artifacts:
paths:
- 'image*.txt'
rules:
- if: $CI_COMMIT_TAG
......@@ -121,10 +126,15 @@ gitlab-opentofu-image:deploy:latest-with-opentofu-version:
variables:
RELEASE_IMAGE_NAME: "$CI_REGISTRY_IMAGE/gitlab-opentofu"
RELEASE_SEMVER: "latest-opentofu${OPENTOFU_VERSION}"
RELEASE_IMAGE: "$RELEASE_IMAGE_NAME:$RELEASE_SEMVER"
before_script:
- crane auth login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
script:
- crane copy "$GITLAB_OPENTOFU_IMAGE_NAME" "$RELEASE_IMAGE_NAME:$RELEASE_SEMVER"
- crane copy "$GITLAB_OPENTOFU_IMAGE_NAME" "$RELEASE_IMAGE"
- echo "- $RELEASE_IMAGE" > image$CI_JOB_ID.txt
artifacts:
paths:
- 'image*.txt'
rules:
- if: $CI_COMMIT_TAG
......@@ -136,10 +146,15 @@ gitlab-opentofu-image:deploy:latest:
variables:
OPENTOFU_VERSION: $LATEST_OPENTOFU_VERSION
RELEASE_IMAGE_NAME: "$CI_REGISTRY_IMAGE/gitlab-opentofu"
RELEASE_IMAGE: "$RELEASE_IMAGE_NAME:$RELEASE_IMAGE_TAG"
before_script:
- crane auth login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
script:
- crane copy "$GITLAB_OPENTOFU_IMAGE_NAME" "$RELEASE_IMAGE_NAME:$RELEASE_IMAGE_TAG"
- crane copy "$GITLAB_OPENTOFU_IMAGE_NAME" "$RELEASE_IMAGE"
- echo "- $RELEASE_IMAGE" > image$CI_JOB_ID.txt
artifacts:
paths:
- 'image*.txt'
rules:
- if: $CI_COMMIT_TAG
parallel:
......@@ -151,18 +166,31 @@ 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
- AVAILABLE_IMAGES=$(cat image*.txt)
- 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+/
release:
tag_name: $CI_COMMIT_TAG
description: './release-notes.md'
......
......@@ -24,3 +24,9 @@ See the [README.md](README.md) for more usage examples.
This release is available with the following OpenTofu versions:
$AVAILABLE_OPENTOFU_VERSIONS
## Available GitLab OpenTofu images
This release deployed the following `gitlab-opentofu` images:
$AVAILABE_IMAGES
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment