Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenTofu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
components
OpenTofu
Commits
3fab262e
Unverified
Commit
3fab262e
authored
1 year ago
by
Timo Furrer
Browse files
Options
Downloads
Patches
Plain Diff
Note built images in release notes
parent
99bc57dc
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+34
-6
34 additions, 6 deletions
.gitlab-ci.yml
.gitlab/release-template.md
+6
-0
6 additions, 0 deletions
.gitlab/release-template.md
with
40 additions
and
6 deletions
.gitlab-ci.yml
+
34
−
6
View file @
3fab262e
...
...
@@ -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'
...
...
This diff is collapsed.
Click to expand it.
.gitlab/release-template.md
+
6
−
0
View file @
3fab262e
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment