Skip to content
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

Improve release instructions and script after the 2.9.0 release #391

Merged
merged 6 commits into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
8 changes: 8 additions & 0 deletions docs/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ Follow the instructions prompted by the `do_release.sh` script. You will need to
> Make sure to Normal Merge the pull request i.e. merge the pull request with merge commit and not a squash merge. This is required because we create the tag
from the pull request, so in order to have the tag on the release branche's history, it has to be a normal merge.

##### On `main`

Once you have done the release on the release branch, there are several steps to follow on `main`.

- The `vitess/lite` image tag must be changed in [101_initial_cluster.yaml](..%2Ftest%2Fendtoend%2Foperator%2F101_initial_cluster.yaml). The latest Vitess release tag must be used.
- We must copy the [operator.yaml](..%2Ftest%2Fendtoend%2Foperator%2Foperator.yaml) file we created during the release onto `main`.
frouioui marked this conversation as resolved.
Show resolved Hide resolved
- Bump the `planetscale/vitess-operator` image tag to the latest version we just released in [operator.yaml](..%2Ftest%2Fendtoend%2Foperator%2Foperator.yaml).

### UI Release

Create a [new release](https://github.com/planetscale/vitess-operator/releases/new)
Expand Down
21 changes: 6 additions & 15 deletions tools/release/do_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,15 @@ fi
function updateVitessImages() {
old_vitess_version=$1
new_vitess_version=$2
new_operator_version=$3

operator_files=$(find -E $ROOT/test/endtoend/operator/* -name "*.yaml" | grep -v "101_initial_cluster.yaml")
operator_files=$(find -E $ROOT/test/endtoend/operator/* -name "*.yaml" | grep -v "101_initial_cluster.yaml" | grep -v "101_initial_cluster_backup.yaml")
sed -i.bak -E "s/vitess\/lite:(.*)/vitess\/lite:v$new_vitess_version/g" $operator_files
sed -i.bak -E "s/vitess\/vtadmin:(.*)/vitess\/vtadmin:v$new_vitess_version/g" $operator_files
sed -i.bak -E "s/vitess\/lite:(.*)/vitess\/lite:v$new_vitess_version\"/g" $ROOT/pkg/apis/planetscale/v2/defaults.go
sed -i.bak -E "s/vitess\/lite:(.*)/vitess\/lite:v$old_vitess_version/g" $ROOT/test/endtoend/operator/101_initial_cluster.yaml
sed -i.bak -E "s/planetscale\/vitess-operator:(.*)/planetscale\/vitess-operator:v$new_operator_version/g" $ROOT/test/endtoend/operator/operator.yaml
sed -i.bak -E "s/vitess\/lite:(.*)/vitess\/lite:v$new_vitess_version-mysql57/g" $ROOT/test/endtoend/operator/101_initial_cluster_backup.yaml

rm -f $(find -E $ROOT/test/endtoend/operator/ -name "*.yaml.bak") $ROOT/pkg/apis/planetscale/v2/defaults.go.bak $ROOT/test/endtoend/operator/operator.yaml.bak
}

function updateOperatorYaml() {
new_operator_version=$1

sed -i.bak -E "s/planetscale\/vitess-operator:(.*)/planetscale\/vitess-operator:v$new_operator_version/g" "$ROOT/deploy/operator.yaml"
rm -f $ROOT/deploy/operator.yaml.bak
rm -f $(find -E $ROOT/test/endtoend/operator/ -name "*.yaml.bak") $ROOT/pkg/apis/planetscale/v2/defaults.go.bak
}

function updateVersion() {
Expand All @@ -63,7 +55,6 @@ fi

updateVersion $NEW_OPERATOR_VERSION
updateVitessImages $OLD_VITESS_VERSION $NEW_VITESS_VERSION $NEW_OPERATOR_VERSION
updateOperatorYaml $NEW_OPERATOR_VERSION

git add --all
git commit -n -s -m "Release commit for $NEW_OPERATOR_VERSION"
Expand All @@ -77,10 +68,10 @@ git commit -n -s -m "Back to dev mode"
echo ""
echo "-----------------------"
echo ""
echo "\tPlease push the new git tag:"
echo "Please push the new git tag:"
echo ""
echo "\t\tgit push origin v$NEW_OPERATOR_VERSION"
echo " git push origin v$NEW_OPERATOR_VERSION"
echo ""
echo "\tAnd push your current branch in order to open a Pull Request against the release branch."
echo "And push your current branch in order to open a Pull Request against the release branch."
echo ""
echo ""