Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OmegaCEN
ci-templates
Commits
3539a685
Commit
3539a685
authored
Mar 30, 2021
by
Teake Nutma
Browse files
Use release-cli script explicitly
Passing env vars around doesn't work for the release keyword.
parent
7e08838b
Changes
1
Hide whitespace changes
Inline
Side-by-side
monthlymerge.yml
View file @
3539a685
...
...
@@ -61,16 +61,22 @@ release_merge_and_tag:on-schedule:
release_gitlab
:
stage
:
release
image
:
omegacen/ci-tools
variables
:
GIT_DEPTH
:
0
rules
:
-
if
:
$CI_COMMIT_TAG =~ /^\d{4}\.\d{2}\.\d+/
script
:
# Determine the previous tag. This is a bit brittle because we're sorting lexicographically by tag name
# instead of topographically in the git tree. But since we're restricting to YYYY.MM.PATCH
# instead of topographically
by commits
in the git tree. But since we're restricting to YYYY.MM.PATCH
# tags, this should be ok.
-
PREVIOUS_TAG=$(git tag --merged ${CI_COMMIT_SHA} | grep -E '^\d{4}.\d{2}.\d+$' | sort | tail -n 2 | head -n 1)
-
PREVIOUS_TAG=$(git tag --merged ${CI_COMMIT_SHA} | grep -P '^\d{4}.\d{2}.\d+$' | sort | tail -n 2 | head -n 1)
-
|
if [ -z "$PREVIOUS_TAG" ]; then
echo "Could not find previous tag, exiting"
false
fi
-
echo "Found previous tag ${PREVIOUS_TAG}"
-
PREVIOUS_TAG_SHA=$(git rev-parse "${PREVIOUS_TAG}")
-
CHANGES=$(git log-mr --output markdown --pretty oneline --target "$CI_DEFAULT_BRANCH" "$PREVIOUS_TAG_SHA..$CI_COMMIT_SHA" | sort --ignore-case)
-
DESCRIPTION='##### Changes'$'\n'$'\n'"$CHANGES"
release
:
tag_name
:
"
$CI_COMMIT_TAG"
description
:
"
$DESCRIPTION"
-
release-cli create --name "$CI_COMMIT_TAG" --description "$DESCRIPTION" --tag-name "$CI_COMMIT_TAG"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment