Skip to content

Update release scripts #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion release/README.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
# Release workflow

This is the recommended release flow in a nutshell for the release 24.3:

----
# start with the product images ...
# create and push the release branch
./release/create-release-branch.sh -b 24.3 -w products -p

# create and push the release tag
./release/create-release-tag.sh -t 24.3.0 -w products -p

# monior the GH action that builds ~80 images for success

# continue with the operators ...
# create and push the release branch
./release/create-release-branch.sh -b 24.3 -w operators -p

# create and push the release tag
./release/create-release-tag.sh -t 24.3.0 -w operators -p

# monior the GH actions that build the oeprator images for success

# finally patch the changelog file in the main branch
# create PRs for all operators
./release/post-release.sh -t 24.3.0 -p

# and that is it!
# (now the tedious post release steps start ...)
----

# Release scripts

A set of scripts that automates some release steps. The release process has multiple steps:
Expand Down Expand Up @@ -124,7 +155,7 @@ e.g.
* for operators:
** checks that the release branch exists and the tag doesn't
** adapts the versions in all cargo.toml to `release-tag` argument
** update all "stackableVersion" fields in the kuttl tests
** update all "operatorVersion" fields in the tests/release.yaml files
** update the antora.yaml
** update the `release-tag` in helm charts
** updates the cargo workspace
Expand Down
2 changes: 1 addition & 1 deletion release/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ operators:
- spark-k8s-operator
- superset-operator
- trino-operator
- zookeeper-operator
- zookeeper-operator
6 changes: 3 additions & 3 deletions release/create-release-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ update_products() {
cd "$BASE_DIR/$DOCKER_IMAGES_REPO"
git pull && git switch "${RELEASE_BRANCH}"
else
git clone "[email protected]:stackabletech/${DOCKER_IMAGES_REPO}.git" "$BASE_DIR/$DOCKER_IMAGES_REPO"
git clone --branch main --depth 1 "[email protected]:stackabletech/${DOCKER_IMAGES_REPO}.git" "$BASE_DIR/$DOCKER_IMAGES_REPO"
cd "$BASE_DIR/$DOCKER_IMAGES_REPO"
git switch "${RELEASE_BRANCH}" || git switch -c "${RELEASE_BRANCH}" "${REPOSITORY}/${BASE_BRANCH}"
fi
Expand All @@ -34,7 +34,7 @@ update_operators() {
cd "$BASE_DIR/${operator}"
git pull && git switch "${RELEASE_BRANCH}"
else
git clone "[email protected]:stackabletech/${operator}.git" "$BASE_DIR/${operator}"
git clone --branch main --depth 1 "[email protected]:stackabletech/${operator}.git" "$BASE_DIR/${operator}"
cd "$BASE_DIR/${operator}"
git switch "${RELEASE_BRANCH}" || git switch -c "${RELEASE_BRANCH}" "${REPOSITORY}/${BASE_BRANCH}"
fi
Expand Down Expand Up @@ -116,7 +116,7 @@ main() {
# check if argument matches our tag regex
#-----------------------------------------------------------
if [[ ! $RELEASE =~ $RELEASE_REGEX ]]; then
echo "Provided tag [$RELEASE] does not match the required tag regex pattern [$RELEASE_REGEX]"
echo "Provided branch name [$RELEASE] does not match the required regex pattern [$RELEASE_REGEX]"
exit 1
fi

Expand Down
12 changes: 3 additions & 9 deletions release/create-release-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,9 @@ update_code() {
echo "No docs found under $1."
fi

#--------------------------------------------------------------------------
# Replace .spec.image.stackableVersion for kuttl tests.
# Use sed as yq does not process .j2 file syntax properly.
# N.B. commented out as the tests assume same stackable version as operator
#--------------------------------------------------------------------------
#if [ -f "$1/tests/test-definition.yaml" ]; then
# # e.g. 2.2.4-stackable0.5.0 -> 2.2.4-stackable23.1
# sed -i "s/-stackable.*/-stackable${RELEASE}/" "$1/tests/test-definition.yaml"
#fi
# Update operator version for the integration tests
# this is used when installing the operators.
yq -i ".releases.tests.products[].operatorVersion |= sub(\"0.0.0-dev\", \"${RELEASE_TAG}\")" "$1/tests/release.yaml"
}

push_branch() {
Expand Down
6 changes: 3 additions & 3 deletions release/post-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ check_operators() {
echo "Dirty working copy found for operator ${operator}"
exit 1
fi
TAG_EXISTS=$(git tag | grep "$RELEASE_TAG")
BRANCH_EXISTS=$(git branch | grep "$RELEASE_BRANCH")
if [ -z "${BRANCH_EXISTS}" ]; then
echo "Expected release branch is missing: ${operator}/$RELEASE_BRANCH"
exit 1
Expand Down Expand Up @@ -93,7 +93,7 @@ update_main_changelog() {
# Maybe push and create pull request
if "$PUSH"; then
git push -u "$REPOSITORY" "$CHANGELOG_BRANCH"
gh pr create --fill --reviewer stackable/developers
gh pr create --fill --reviewer stackable/developers --head "$CHANGELOG_BRANCH" --base main
fi
done < <(yq '... comments="" | .operators[] ' "$INITIAL_DIR"/release/config.yaml)
}
Expand Down Expand Up @@ -121,7 +121,7 @@ main() {
# sanity checks before we start: folder, branches etc.
# deactivate -e so that piped commands can be used
set +e
checks_operators
check_operators
set -e

echo "Update main changelog from release $RELEASE_TAG"
Expand Down