Skip to content

Commit d8e640e

Browse files
authored
Update release scripts (#63)
* Update tests/release.yaml with operator versions * shallow clone of docker-images * no empty line at the end of config.yaml * fix path to release.yaml * fix: post release script * document release workflow
1 parent 7a9ffc2 commit d8e640e

File tree

5 files changed

+42
-17
lines changed

5 files changed

+42
-17
lines changed

release/README.adoc

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
# Release workflow
2+
3+
This is the recommended release flow in a nutshell for the release 24.3:
4+
5+
----
6+
# start with the product images ...
7+
# create and push the release branch
8+
./release/create-release-branch.sh -b 24.3 -w products -p
9+
10+
# create and push the release tag
11+
./release/create-release-tag.sh -t 24.3.0 -w products -p
12+
13+
# monior the GH action that builds ~80 images for success
14+
15+
# continue with the operators ...
16+
# create and push the release branch
17+
./release/create-release-branch.sh -b 24.3 -w operators -p
18+
19+
# create and push the release tag
20+
./release/create-release-tag.sh -t 24.3.0 -w operators -p
21+
22+
# monior the GH actions that build the oeprator images for success
23+
24+
# finally patch the changelog file in the main branch
25+
# create PRs for all operators
26+
./release/post-release.sh -t 24.3.0 -p
27+
28+
# and that is it!
29+
# (now the tedious post release steps start ...)
30+
----
31+
132
# Release scripts
233

334
A set of scripts that automates some release steps. The release process has multiple steps:
@@ -124,7 +155,7 @@ e.g.
124155
* for operators:
125156
** checks that the release branch exists and the tag doesn't
126157
** adapts the versions in all cargo.toml to `release-tag` argument
127-
** update all "stackableVersion" fields in the kuttl tests
158+
** update all "operatorVersion" fields in the tests/release.yaml files
128159
** update the antora.yaml
129160
** update the `release-tag` in helm charts
130161
** updates the cargo workspace

release/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ operators:
1616
- spark-k8s-operator
1717
- superset-operator
1818
- trino-operator
19-
- zookeeper-operator
19+
- zookeeper-operator

release/create-release-branch.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ update_products() {
1919
cd "$BASE_DIR/$DOCKER_IMAGES_REPO"
2020
git pull && git switch "${RELEASE_BRANCH}"
2121
else
22-
git clone "[email protected]:stackabletech/${DOCKER_IMAGES_REPO}.git" "$BASE_DIR/$DOCKER_IMAGES_REPO"
22+
git clone --branch main --depth 1 "[email protected]:stackabletech/${DOCKER_IMAGES_REPO}.git" "$BASE_DIR/$DOCKER_IMAGES_REPO"
2323
cd "$BASE_DIR/$DOCKER_IMAGES_REPO"
2424
git switch "${RELEASE_BRANCH}" || git switch -c "${RELEASE_BRANCH}" "${REPOSITORY}/${BASE_BRANCH}"
2525
fi
@@ -34,7 +34,7 @@ update_operators() {
3434
cd "$BASE_DIR/${operator}"
3535
git pull && git switch "${RELEASE_BRANCH}"
3636
else
37-
git clone "[email protected]:stackabletech/${operator}.git" "$BASE_DIR/${operator}"
37+
git clone --branch main --depth 1 "[email protected]:stackabletech/${operator}.git" "$BASE_DIR/${operator}"
3838
cd "$BASE_DIR/${operator}"
3939
git switch "${RELEASE_BRANCH}" || git switch -c "${RELEASE_BRANCH}" "${REPOSITORY}/${BASE_BRANCH}"
4040
fi
@@ -116,7 +116,7 @@ main() {
116116
# check if argument matches our tag regex
117117
#-----------------------------------------------------------
118118
if [[ ! $RELEASE =~ $RELEASE_REGEX ]]; then
119-
echo "Provided tag [$RELEASE] does not match the required tag regex pattern [$RELEASE_REGEX]"
119+
echo "Provided branch name [$RELEASE] does not match the required regex pattern [$RELEASE_REGEX]"
120120
exit 1
121121
fi
122122

release/create-release-tag.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,9 @@ update_code() {
146146
echo "No docs found under $1."
147147
fi
148148

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

160154
push_branch() {

release/post-release.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ check_operators() {
5656
echo "Dirty working copy found for operator ${operator}"
5757
exit 1
5858
fi
59-
TAG_EXISTS=$(git tag | grep "$RELEASE_TAG")
59+
BRANCH_EXISTS=$(git branch | grep "$RELEASE_BRANCH")
6060
if [ -z "${BRANCH_EXISTS}" ]; then
6161
echo "Expected release branch is missing: ${operator}/$RELEASE_BRANCH"
6262
exit 1
@@ -93,7 +93,7 @@ update_main_changelog() {
9393
# Maybe push and create pull request
9494
if "$PUSH"; then
9595
git push -u "$REPOSITORY" "$CHANGELOG_BRANCH"
96-
gh pr create --fill --reviewer stackable/developers
96+
gh pr create --fill --reviewer stackable/developers --head "$CHANGELOG_BRANCH" --base main
9797
fi
9898
done < <(yq '... comments="" | .operators[] ' "$INITIAL_DIR"/release/config.yaml)
9999
}
@@ -121,7 +121,7 @@ main() {
121121
# sanity checks before we start: folder, branches etc.
122122
# deactivate -e so that piped commands can be used
123123
set +e
124-
checks_operators
124+
check_operators
125125
set -e
126126

127127
echo "Update main changelog from release $RELEASE_TAG"

0 commit comments

Comments
 (0)