From 99c11c8755c98e5e630177652f2b5d98908d6835 Mon Sep 17 00:00:00 2001 From: Manan Gupta Date: Tue, 10 Oct 2023 19:59:17 +0530 Subject: [PATCH 1/2] feat: fix script to work irrespective of the mysql version in the yaml files Signed-off-by: Manan Gupta --- tools/release/do_release.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/release/do_release.sh b/tools/release/do_release.sh index 08932468..109ebe4e 100755 --- a/tools/release/do_release.sh +++ b/tools/release/do_release.sh @@ -29,10 +29,10 @@ function updateVitessImages() { new_operator_version=$3 operator_files=$(find -E $ROOT/test/endtoend/operator/* -name "*.yaml" | grep -v "101_initial_cluster.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/vitess\/lite:([^-]*)(-rc[0-9]*)?(-mysql..)?/vitess\/lite:v$new_vitess_version\3/g" $operator_files + sed -i.bak -E "s/vitess\/vtadmin:([^-]*)(-rc[0-9]*)?(-mysql..)?/vitess\/vtadmin:v$new_vitess_version\3/g" $operator_files + sed -i.bak -E "s/vitess\/lite:([^-]*)(-rc[0-9]*)?(-mysql..)?/vitess\/lite:v$new_vitess_version\3\"/g" $ROOT/pkg/apis/planetscale/v2/defaults.go + sed -i.bak -E "s/vitess\/lite:([^-]*)(-rc[0-9]*)?(-mysql..)?/vitess\/lite:v$old_vitess_version\3/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 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 From c2b140d50c9b27faf1a9b5c86b1052d30cc13708 Mon Sep 17 00:00:00 2001 From: Manan Gupta Date: Tue, 10 Oct 2023 20:41:26 +0530 Subject: [PATCH 2/2] feat: be a little more permissive with the MySQL version in the script Signed-off-by: Manan Gupta --- tools/release/do_release.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/release/do_release.sh b/tools/release/do_release.sh index 109ebe4e..08779add 100755 --- a/tools/release/do_release.sh +++ b/tools/release/do_release.sh @@ -29,10 +29,10 @@ function updateVitessImages() { new_operator_version=$3 operator_files=$(find -E $ROOT/test/endtoend/operator/* -name "*.yaml" | grep -v "101_initial_cluster.yaml") - sed -i.bak -E "s/vitess\/lite:([^-]*)(-rc[0-9]*)?(-mysql..)?/vitess\/lite:v$new_vitess_version\3/g" $operator_files - sed -i.bak -E "s/vitess\/vtadmin:([^-]*)(-rc[0-9]*)?(-mysql..)?/vitess\/vtadmin:v$new_vitess_version\3/g" $operator_files - sed -i.bak -E "s/vitess\/lite:([^-]*)(-rc[0-9]*)?(-mysql..)?/vitess\/lite:v$new_vitess_version\3\"/g" $ROOT/pkg/apis/planetscale/v2/defaults.go - sed -i.bak -E "s/vitess\/lite:([^-]*)(-rc[0-9]*)?(-mysql..)?/vitess\/lite:v$old_vitess_version\3/g" $ROOT/test/endtoend/operator/101_initial_cluster.yaml + sed -i.bak -E "s/vitess\/lite:([^-]*)(-rc[0-9]*)?(-mysql.*)?/vitess\/lite:v$new_vitess_version\3/g" $operator_files + sed -i.bak -E "s/vitess\/vtadmin:([^-]*)(-rc[0-9]*)?(-mysql.*)?/vitess\/vtadmin:v$new_vitess_version\3/g" $operator_files + sed -i.bak -E "s/vitess\/lite:([^-]*)(-rc[0-9]*)?(-mysql.*)?/vitess\/lite:v$new_vitess_version\3\"/g" $ROOT/pkg/apis/planetscale/v2/defaults.go + sed -i.bak -E "s/vitess\/lite:([^-]*)(-rc[0-9]*)?(-mysql.*)?/vitess\/lite:v$old_vitess_version\3/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 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