From 31f6c2c2eacfbaa311b7f37c6c2744b982e57c32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Sun, 21 Nov 2021 11:33:30 +0100 Subject: [PATCH 1/9] tools: Update comments about the kata-deploy yaml changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The comments were mentioning kata-deploy-base files while it really should mention kata-deploy-stable files. While here, I've also added a missing '"' to one of the tags. Signed-off-by: Fabiano Fidêncio --- .../release/update-repository-version.sh | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/tools/packaging/release/update-repository-version.sh b/tools/packaging/release/update-repository-version.sh index cded448cc0..6a5a3e7ff7 100755 --- a/tools/packaging/release/update-repository-version.sh +++ b/tools/packaging/release/update-repository-version.sh @@ -117,37 +117,37 @@ bump_repo() { # 1) [main] ------> [main] NO-OP # "alpha0" "alpha1" # - # +----------------+----------------+ - # | from | to | - # -----------------+----------------+----------------+ - # kata-deploy | "latest" | "latest" | - # -----------------+----------------+----------------+ - # kata-deploy-base | "stable | "stable" | - # -----------------+----------------+----------------+ + # +----------------+----------------+ + # | from | to | + # -------------------+----------------+----------------+ + # kata-deploy | "latest" | "latest" | + # -------------------+----------------+----------------+ + # kata-deploy-stable | "stable | "stable" | + # -------------------+----------------+----------------+ # # # 2) [main] ------> [stable] Update kata-deploy and - # "alpha2" "rc0" get rid of kata-deploy-base + # "alpha2" "rc0" get rid of kata-deploy-stable # - # +----------------+----------------+ - # | from | to | - # -----------------+----------------+----------------+ - # kata-deploy | "latest" | "rc0" | - # -----------------+----------------+----------------+ - # kata-deploy-base | "stable" | REMOVED | - # -----------------+----------------+----------------+ + # +----------------+----------------+ + # | from | to | + # -------------------+----------------+----------------+ + # kata-deploy | "latest" | "rc0" | + # -------------------+----------------+----------------+ + # kata-deploy-stable | "stable" | REMOVED | + # -------------------+----------------+----------------+ # # # 3) [stable] ------> [stable] Update kata-deploy # "x.y.z" "x.y.(z+1)" # - # +----------------+----------------+ - # | from | to | - # -----------------+----------------+----------------+ - # kata-deploy | "x.y.z" | "x.y.(z+1)" | - # -----------------+----------------+----------------+ - # kata-deploy-base | NON-EXISTENT | NON-EXISTENT | - # -----------------+----------------+----------------+ + # +----------------+----------------+ + # | from | to | + # -------------------+----------------+----------------+ + # kata-deploy | "x.y.z" | "x.y.(z+1)" | + # -------------------+----------------+----------------+ + # kata-deploy-stable | NON-EXISTENT | NON-EXISTENT | + # -------------------+----------------+----------------+ info "Updating kata-deploy / kata-cleanup image tags" if [ "${target_branch}" == "main" ] && [[ "${new_version}" =~ "rc" ]]; then From edca82924268887fb94bd0ebed1392f90636d7d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Sun, 21 Nov 2021 11:07:44 +0100 Subject: [PATCH 2/9] tools: Rewrite the logic around kata-deploy changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can simplify the code a little bit, as at least now we group common operationr together. Hopefully this will improve the maintainability and the readability of the code. Signed-off-by: Fabiano Fidêncio --- .../release/update-repository-version.sh | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/tools/packaging/release/update-repository-version.sh b/tools/packaging/release/update-repository-version.sh index 6a5a3e7ff7..2fec951d23 100755 --- a/tools/packaging/release/update-repository-version.sh +++ b/tools/packaging/release/update-repository-version.sh @@ -150,24 +150,26 @@ bump_repo() { # -------------------+----------------+----------------+ info "Updating kata-deploy / kata-cleanup image tags" - if [ "${target_branch}" == "main" ] && [[ "${new_version}" =~ "rc" ]]; then - # case 2) - ## change the "latest" tag to the "#{new_version}" one - sed -i "s#quay.io/kata-containers/kata-deploy:latest#quay.io/kata-containers/kata-deploy:${new_version}#g" tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml - sed -i "s#quay.io/kata-containers/kata-deploy:latest#quay.io/kata-containers/kata-deploy:${new_version}#g" tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml + local version_to_replace="${current_version}" + local replacement="${new_version}" + if [ "${target_branch}" == "main" ]; then + if [[ "${new_version}" =~ "rc" ]]; then + ## this is the case 2) where we remove te kata-deploy / kata-cleanup stable files + git rm tools/packaging/kata-deploy/kata-deploy/base/kata-deploy-stable.yaml + git rm tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup-stable.yaml + else + ## this is the case 1) where we just do nothing + replacement="latest" + fi - git diff + version_to_replace="latest" + fi - git add tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml - git add tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml + if [ "${version_to_replace}" != "${replacement}" ]; then + ## this covers case 2) and 3), as on both of them we have changes on kata-deploy / kata-cleanup files + sed -i "s#quay.io/kata-containers/kata-deploy:${version_to_replace}#quay.io/kata-containers/kata-deploy:${replacement}#g" tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml + sed -i "s#quay.io/kata-containers/kata-deploy:${version_to_replace}#quay.io/kata-containers/kata-deploy:${replacement}#g" tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml - ## and remove the kata-deploy & kata-cleanup stable yaml files - git rm tools/packaging/kata-deploy/kata-deploy/base/kata-deploy-stable.yaml - git rm tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup-stable.yaml - elif [[ "${target_branch}" =~ "stable" ]]; then - # case 3) - sed -i "s#quay.io/kata-containers/kata-deploy:${current_version}#quay.io/kata-containers/kata-deploy:${new_version}#g" tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml - sed -i "s#quay.io/kata-containers/kata-deploy:${current_version}#quay.io/kata-containers/kata-deploy:${new_version}#g" tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml git diff git add tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml From ac958a3073b382a4fdfd8ddb8f6d2569303feb2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Tue, 23 Nov 2021 10:36:20 +0100 Subject: [PATCH 3/9] tools: Use vars for the yaml files used in the update repo script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of always writing the full path of some files, let's just create some vars and avoid both repetition (which is quite error prone) and too long lines (which makes the file not so easy to read). Signed-off-by: Fabiano Fidêncio --- .../release/update-repository-version.sh | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tools/packaging/release/update-repository-version.sh b/tools/packaging/release/update-repository-version.sh index 2fec951d23..eddee58348 100755 --- a/tools/packaging/release/update-repository-version.sh +++ b/tools/packaging/release/update-repository-version.sh @@ -90,6 +90,14 @@ bump_repo() { pushd "${repo}" >>/dev/null + local kata_deploy_dir="tools/packaging/kata-deploy" + local kata_deploy_base="${kata_deploy_dir}/kata-deploy/base" + local kata_cleanup_base="${kata_deploy_dir}/kata-cleanup/base" + local kata_deploy_yaml="${kata_deploy_base}/kata-deploy.yaml" + local kata_cleanup_yaml="${kata_cleanup_base}/kata-cleanup.yaml" + local kata_deploy_stable_yaml="${kata_deploy_base}/kata-deploy-stable.yaml" + local kata_cleanup_stable_yaml="${kata_cleanup_base}/kata-cleanup-stable.yaml" + branch="${new_version}-branch-bump" git fetch origin "${target_branch}" git checkout "origin/${target_branch}" -b "${branch}" @@ -155,25 +163,25 @@ bump_repo() { if [ "${target_branch}" == "main" ]; then if [[ "${new_version}" =~ "rc" ]]; then ## this is the case 2) where we remove te kata-deploy / kata-cleanup stable files - git rm tools/packaging/kata-deploy/kata-deploy/base/kata-deploy-stable.yaml - git rm tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup-stable.yaml + git rm "${kata_deploy_stable_yaml}" + git rm "${kata_cleanup_stable_yaml}" + else ## this is the case 1) where we just do nothing replacement="latest" fi - version_to_replace="latest" fi if [ "${version_to_replace}" != "${replacement}" ]; then ## this covers case 2) and 3), as on both of them we have changes on kata-deploy / kata-cleanup files - sed -i "s#quay.io/kata-containers/kata-deploy:${version_to_replace}#quay.io/kata-containers/kata-deploy:${replacement}#g" tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml - sed -i "s#quay.io/kata-containers/kata-deploy:${version_to_replace}#quay.io/kata-containers/kata-deploy:${replacement}#g" tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml + sed -i "s#quay.io/kata-containers/kata-deploy:${version_to_replace}#quay.io/kata-containers/kata-deploy:${new_version}#g" "${kata_deploy_yaml}" + sed -i "s#quay.io/kata-containers/kata-deploy:${version_to_replace}#quay.io/kata-containers/kata-deploy:${new_version}#g" "${kata_cleanup_yaml}" git diff - git add tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml - git add tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml + git add "${kata_deploy_yaml}" + git add "${kata_cleanup_yaml}" fi fi From c8e22daf6773828de4bfef965ffa9bcdbc85dcdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Tue, 23 Nov 2021 10:41:06 +0100 Subject: [PATCH 4/9] tools: Use vars for the registry in the update repo script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Similarly to what was done for the yaml files, let's use a var for representing the registry where our images will be pushed to and avoid repetition and too long lines. Signed-off-by: Fabiano Fidêncio --- tools/packaging/release/update-repository-version.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/packaging/release/update-repository-version.sh b/tools/packaging/release/update-repository-version.sh index eddee58348..856a22bffd 100755 --- a/tools/packaging/release/update-repository-version.sh +++ b/tools/packaging/release/update-repository-version.sh @@ -157,6 +157,8 @@ bump_repo() { # kata-deploy-stable | NON-EXISTENT | NON-EXISTENT | # -------------------+----------------+----------------+ + local registry="quay.io/kata-containers/kata-deploy" + info "Updating kata-deploy / kata-cleanup image tags" local version_to_replace="${current_version}" local replacement="${new_version}" @@ -175,8 +177,8 @@ bump_repo() { if [ "${version_to_replace}" != "${replacement}" ]; then ## this covers case 2) and 3), as on both of them we have changes on kata-deploy / kata-cleanup files - sed -i "s#quay.io/kata-containers/kata-deploy:${version_to_replace}#quay.io/kata-containers/kata-deploy:${new_version}#g" "${kata_deploy_yaml}" - sed -i "s#quay.io/kata-containers/kata-deploy:${version_to_replace}#quay.io/kata-containers/kata-deploy:${new_version}#g" "${kata_cleanup_yaml}" + sed -i "s#${registry}:${version_to_replace}#${registry}:${new_version}#g" "${kata_deploy_yaml}" + sed -i "s#${registry}:${version_to_replace}#${registry}:${new_version}#g" "${kata_cleanup_yaml}" git diff 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 5/9] 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 856a22bffd..1cb0c02fa1 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 From 76540dbdd14d72abc7cf8e26b0e617789a4cb9b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Sun, 21 Nov 2021 12:11:16 +0100 Subject: [PATCH 6/9] tools: Automatically revert kata-deploy changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When branching the "stable-x.y" branch, we need to do some quite specific changes to kata-deploy / kata-cleanup files, such as: * changing the tags from "latest" to "stable-x.y". * removing the kata-deploy / kata-cleanup stable files. However, after the branching is done, we need to get the `main` repo to its original state, with the kata-deploy / kata-cleanup using the "latest" tag, and with the stable files present there, and this commit ensures that, during the release process, a new PR is automatically created with these changes. Fixes: #3069 Signed-off-by: Fabiano Fidêncio --- .../release/update-repository-version.sh | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tools/packaging/release/update-repository-version.sh b/tools/packaging/release/update-repository-version.sh index 1cb0c02fa1..624cac8d3c 100755 --- a/tools/packaging/release/update-repository-version.sh +++ b/tools/packaging/release/update-repository-version.sh @@ -82,6 +82,18 @@ 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_revert_kata_deploy_commit() { + local new_version=$1 + [ -n "$new_version" ] || die "no new version" + + printf "release: Revert kata-deploy changes after %s release" "${new_version}" + + printf "\n +As %s has been released, let's switch the kata-deploy / kata-cleanup +tags back to \"latest\", and re-add the kata-deploy-stable and the +kata-cleanup-stable files." "${new_version}" +} + generate_commit() { local new_version=$1 local current_version=$2 @@ -208,6 +220,7 @@ bump_repo() { info "Creating the commit with the kata-deploy changes" local commit_msg="$(generate_kata_deploy_commit $new_version)" git commit -s -m "${commit_msg}" + local kata_deploy_commit="$(git rev-parse HEAD)" fi fi @@ -244,6 +257,29 @@ EOT out="" out=$("${hub_bin}" pull-request -b "${target_branch}" -F "${notes_file}" 2>&1) || echo "$out" | grep "A pull request already exists" fi + + if [ "${repo}" == "kata-containers" ] && [ "${target_branch}" == "main" ] && [[ "${new_version}" =~ "rc" ]]; then + reverting_kata_deploy_changes_branch="revert-kata-deploy-changes-after-${new_version}-release" + git checkout -b "${reverting_kata_deploy_changes_branch}" + + git revert --no-edit ${kata_deploy_commit} >>/dev/null + commit_msg="$(generate_revert_kata_deploy_commit $new_version)" + info "Creating the commit message reverting the kata-deploy changes" + git commit --amend -s -m "${commit_msg}" + + echo "${commit_msg}" >"${notes_file}" + echo "" >>"${notes_file}" + echo "Only merge this commit after ${new_version} release is successfully tagged!" >>"${notes_file}" + + if [[ ${PUSH} == "true" ]]; then + info "Push \"${reverting_kata_deploy_changes_branch}\" to fork" + ${hub_bin} push fork -f "${reverting_kata_deploy_changes_branch}" + info "Create \"${reverting_kata_deploy_changes_branch}\" PR" + out="" + out=$("${hub_bin}" pull-request -b "${target_branch}" -F "${notes_file}" 2>&1) || echo "$out" | grep "A pull request already exists" + fi + fi + popd >>/dev/null } From 85eb743f466651910abeee8db28b2945cd962998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Tue, 23 Nov 2021 11:39:57 +0100 Subject: [PATCH 7/9] tools: Make hub usage slightly less fragile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `grep`ing by a specific output, in a specific language, is quite fragile and could easily break `hub`. For now, let's work this around following James' suggestion of setting `LC_ALL=C LANG=C` when calling `hub`. > **Note**: I don't think we should invest much time on fixing `hub` > usage, as it'll be soon replaced by `gh`, see: > https://github.com/kata-containers/kata-containers/issues/3083 Signed-off-by: Fabiano Fidêncio --- tools/packaging/release/update-repository-version.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/packaging/release/update-repository-version.sh b/tools/packaging/release/update-repository-version.sh index 624cac8d3c..5a01b18400 100755 --- a/tools/packaging/release/update-repository-version.sh +++ b/tools/packaging/release/update-repository-version.sh @@ -255,7 +255,7 @@ EOT ${hub_bin} push fork -f "${branch}" info "Create PR" out="" - out=$("${hub_bin}" pull-request -b "${target_branch}" -F "${notes_file}" 2>&1) || echo "$out" | grep "A pull request already exists" + out=$(LC_ALL=C LANG=C "${hub_bin}" pull-request -b "${target_branch}" -F "${notes_file}" 2>&1) || echo "$out" | grep "A pull request already exists" fi if [ "${repo}" == "kata-containers" ] && [ "${target_branch}" == "main" ] && [[ "${new_version}" =~ "rc" ]]; then @@ -276,7 +276,7 @@ EOT ${hub_bin} push fork -f "${reverting_kata_deploy_changes_branch}" info "Create \"${reverting_kata_deploy_changes_branch}\" PR" out="" - out=$("${hub_bin}" pull-request -b "${target_branch}" -F "${notes_file}" 2>&1) || echo "$out" | grep "A pull request already exists" + out=$(LC_ALL=C LANG=C "${hub_bin}" pull-request -b "${target_branch}" -F "${notes_file}" 2>&1) || echo "$out" | grep "A pull request already exists" fi fi From 5dbd752f8ff7bb271d8463a558df2102be5f5691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Tue, 23 Nov 2021 11:45:16 +0100 Subject: [PATCH 8/9] tools: Remove the check for the VERSION file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All repos we release (https://github.com/kata-containers/kata-containers and https://github.com/kata-containers/tests) have a VERSION file. Keeping a check for it, although useful for a new repo, just complicates the use-case we currently deal with. While here, let's also anchor the '#' and potentially exclude blank lines, following James' suggestion. Signed-off-by: Fabiano Fidêncio --- .../release/update-repository-version.sh | 23 +++++-------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/tools/packaging/release/update-repository-version.sh b/tools/packaging/release/update-repository-version.sh index 5a01b18400..c802773699 100755 --- a/tools/packaging/release/update-repository-version.sh +++ b/tools/packaging/release/update-repository-version.sh @@ -36,10 +36,6 @@ trap 'handle_error $LINENO' ERR get_changes() { local current_version=$1 [ -n "${current_version}" ] || die "current version not provided" - if [ "${current_version}" == "new" ];then - echo "Starting to version this repository" - return - fi # If for some reason there is not a tag this could fail # better fail and write the error in the PR @@ -134,20 +130,13 @@ bump_repo() { git fetch origin "${target_branch}" git checkout "origin/${target_branch}" -b "${branch}" - # All repos we build should have a VERSION file - if [ ! -f "VERSION" ]; then - current_version="new" - echo "${new_version}" >VERSION - else - current_version="$(grep -v '#' ./VERSION)" + local current_version="$(egrep -v '^(#|$)' ./VERSION)" - info "Updating VERSION file" - echo "${new_version}" >VERSION - if git diff --exit-code; then - info "${repo} already in version ${new_version}" - cat VERSION - return 0 - fi + info "Updating VERSION file" + echo "${new_version}" >VERSION + if git diff --exit-code; then + info "${repo} already in version ${new_version}" + return 0 fi if [ "${repo}" == "kata-containers" ]; then From 5ba2f52c7316db60b9d85911b2cb626720f99b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Tue, 23 Nov 2021 13:00:48 +0100 Subject: [PATCH 9/9] tools: Quote functions arguments in the update repos script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Although this is not strictly needed, better be safe than sorry on those cases. Signed-off-by: Fabiano Fidêncio --- .../packaging/release/update-repository-version.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/packaging/release/update-repository-version.sh b/tools/packaging/release/update-repository-version.sh index c802773699..4703032cbc 100755 --- a/tools/packaging/release/update-repository-version.sh +++ b/tools/packaging/release/update-repository-version.sh @@ -34,7 +34,7 @@ handle_error() { trap 'handle_error $LINENO' ERR get_changes() { - local current_version=$1 + local current_version="$1" [ -n "${current_version}" ] || die "current version not provided" # If for some reason there is not a tag this could fail @@ -59,7 +59,7 @@ get_changes() { } generate_kata_deploy_commit() { - local new_version=$1 + local new_version="$1" [ -n "$new_version" ] || die "no new version" printf "release: Adapt kata-deploy for %s" "${new_version}" @@ -79,7 +79,7 @@ There are no changes when doing an alpha release, as the files on the } generate_revert_kata_deploy_commit() { - local new_version=$1 + local new_version="$1" [ -n "$new_version" ] || die "no new version" printf "release: Revert kata-deploy changes after %s release" "${new_version}" @@ -91,8 +91,8 @@ kata-cleanup-stable files." "${new_version}" } generate_commit() { - local new_version=$1 - local current_version=$2 + local new_version="$1" + local current_version="$2" [ -n "$new_version" ] || die "no new version" [ -n "$current_version" ] || die "no current version" @@ -305,8 +305,8 @@ main(){ shift $((OPTIND - 1)) - new_version=${1:-} - target_branch=${2:-} + new_version="${1:-}" + target_branch="${2:-}" [ -n "${new_version}" ] || { echo "ERROR: no new version" && usage 1; } [ -n "${target_branch}" ] || die "no target branch" for repo in "${repos[@]}"