diff --git a/release/README.adoc b/release/README.adoc index c896c67..3792deb 100644 --- a/release/README.adoc +++ b/release/README.adoc @@ -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: @@ -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 diff --git a/release/config.yaml b/release/config.yaml index 8c560b3..61414ec 100644 --- a/release/config.yaml +++ b/release/config.yaml @@ -16,4 +16,4 @@ operators: - spark-k8s-operator - superset-operator - trino-operator - - zookeeper-operator + - zookeeper-operator \ No newline at end of file diff --git a/release/create-release-branch.sh b/release/create-release-branch.sh index 7869b7c..5edd4f9 100755 --- a/release/create-release-branch.sh +++ b/release/create-release-branch.sh @@ -19,7 +19,7 @@ update_products() { cd "$BASE_DIR/$DOCKER_IMAGES_REPO" git pull && git switch "${RELEASE_BRANCH}" else - git clone "git@github.com:stackabletech/${DOCKER_IMAGES_REPO}.git" "$BASE_DIR/$DOCKER_IMAGES_REPO" + git clone --branch main --depth 1 "git@github.com: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 @@ -34,7 +34,7 @@ update_operators() { cd "$BASE_DIR/${operator}" git pull && git switch "${RELEASE_BRANCH}" else - git clone "git@github.com:stackabletech/${operator}.git" "$BASE_DIR/${operator}" + git clone --branch main --depth 1 "git@github.com:stackabletech/${operator}.git" "$BASE_DIR/${operator}" cd "$BASE_DIR/${operator}" git switch "${RELEASE_BRANCH}" || git switch -c "${RELEASE_BRANCH}" "${REPOSITORY}/${BASE_BRANCH}" fi @@ -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 diff --git a/release/create-release-tag.sh b/release/create-release-tag.sh index f944e9d..4bd0ba8 100755 --- a/release/create-release-tag.sh +++ b/release/create-release-tag.sh @@ -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() { diff --git a/release/post-release.sh b/release/post-release.sh index 6b4240a..3020f49 100755 --- a/release/post-release.sh +++ b/release/post-release.sh @@ -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 @@ -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) } @@ -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"