From 36d73c96c836a1797f86910b5e4e063c99183700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Sun, 21 Nov 2021 11:27:42 +0100 Subject: [PATCH] tools: Do the kata-deploy changes on its own commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rather than doing the kata-deploy changes as part of the release bump commit, let's split those on its own changes, as it will both make the life of the reviewer less confusing and also allows us to start preparing the field for a possible automated revert of these changes, whenever it becomes needed. Signed-off-by: Fabiano FidĂȘncio --- .../release/update-repository-version.sh | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tools/packaging/release/update-repository-version.sh b/tools/packaging/release/update-repository-version.sh index 856a22bff..1cb0c02fa 100755 --- a/tools/packaging/release/update-repository-version.sh +++ b/tools/packaging/release/update-repository-version.sh @@ -62,6 +62,26 @@ get_changes() { git log --oneline "${current_version}..HEAD" --no-merges } +generate_kata_deploy_commit() { + local new_version=$1 + [ -n "$new_version" ] || die "no new version" + + printf "release: Adapt kata-deploy for %s" "${new_version}" + + printf "\n +kata-deploy files must be adapted to a new release. The cases where it +happens are when the release goes from -> to: +* main -> stable: + * kata-deploy / kata-cleanup: change from \"latest\" to \"rc0\" + * kata-deploy-stable / kata-cleanup-stable: are removed + +* stable -> stable: + * kata-deploy / kata-cleanup: bump the release to the new one. + +There are no changes when doing an alpha release, as the files on the +\"main\" branch always point to the \"latest\" and \"stable\" tags." +} + generate_commit() { local new_version=$1 local current_version=$2 @@ -184,6 +204,10 @@ bump_repo() { git add "${kata_deploy_yaml}" git add "${kata_cleanup_yaml}" + + info "Creating the commit with the kata-deploy changes" + local commit_msg="$(generate_kata_deploy_commit $new_version)" + git commit -s -m "${commit_msg}" fi fi