Skip to content

Commit

Permalink
Merge pull request #391 from planetscale/improve-release-instructions
Browse files Browse the repository at this point in the history
Improve release instructions and script after the `2.9.0` release
  • Loading branch information
frouioui authored Mar 3, 2023
2 parents bad2dfc + 83a5470 commit b535f33
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
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-latest.yaml](..%2Ftest%2Fendtoend%2Foperator%2Foperator-latest.yaml) file we created during the release onto `main`'s [operator.yaml](..%2Ftest%2Fendtoend%2Foperator%2Foperator.yaml) file.
- 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 ""

0 comments on commit b535f33

Please sign in to comment.