mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-15 16:13:20 +00:00
Merge pull request #3977 from fidencio/wip/backport-fix-for-3847
stable-2.4 | tools: release: Do not consider release candidates as stable releases
This commit is contained in:
commit
44b1473d0c
@ -68,7 +68,6 @@ generate_kata_deploy_commit() {
|
|||||||
kata-deploy files must be adapted to a new release. The cases where it
|
kata-deploy files must be adapted to a new release. The cases where it
|
||||||
happens are when the release goes from -> to:
|
happens are when the release goes from -> to:
|
||||||
* main -> stable:
|
* main -> stable:
|
||||||
* kata-deploy / kata-cleanup: change from \"latest\" to \"rc0\"
|
|
||||||
* kata-deploy-stable / kata-cleanup-stable: are removed
|
* kata-deploy-stable / kata-cleanup-stable: are removed
|
||||||
|
|
||||||
* stable -> stable:
|
* stable -> stable:
|
||||||
@ -161,7 +160,7 @@ bump_repo() {
|
|||||||
# +----------------+----------------+
|
# +----------------+----------------+
|
||||||
# | from | to |
|
# | from | to |
|
||||||
# -------------------+----------------+----------------+
|
# -------------------+----------------+----------------+
|
||||||
# kata-deploy | "latest" | "rc0" |
|
# kata-deploy | "latest" | "latest" |
|
||||||
# -------------------+----------------+----------------+
|
# -------------------+----------------+----------------+
|
||||||
# kata-deploy-stable | "stable" | REMOVED |
|
# kata-deploy-stable | "stable" | REMOVED |
|
||||||
# -------------------+----------------+----------------+
|
# -------------------+----------------+----------------+
|
||||||
@ -183,23 +182,32 @@ bump_repo() {
|
|||||||
info "Updating kata-deploy / kata-cleanup image tags"
|
info "Updating kata-deploy / kata-cleanup image tags"
|
||||||
local version_to_replace="${current_version}"
|
local version_to_replace="${current_version}"
|
||||||
local replacement="${new_version}"
|
local replacement="${new_version}"
|
||||||
|
local removed_files=false
|
||||||
if [ "${target_branch}" == "main" ]; then
|
if [ "${target_branch}" == "main" ]; then
|
||||||
if [[ "${new_version}" =~ "rc" ]]; then
|
if [[ "${new_version}" =~ "rc" ]]; then
|
||||||
## this is the case 2) where we remove te kata-deploy / kata-cleanup stable files
|
## this is the case 2) where we remove te kata-deploy / kata-cleanup stable files
|
||||||
git rm "${kata_deploy_stable_yaml}"
|
git rm "${kata_deploy_stable_yaml}"
|
||||||
git rm "${kata_cleanup_stable_yaml}"
|
git rm "${kata_cleanup_stable_yaml}"
|
||||||
|
|
||||||
else
|
removed_files=true
|
||||||
## this is the case 1) where we just do nothing
|
fi
|
||||||
|
|
||||||
|
## these are the cases 1) and 2), where "alpha" and "rc0" are tagged as "latest"
|
||||||
|
version_to_replace="latest"
|
||||||
|
replacement="latest"
|
||||||
|
else
|
||||||
|
if [[ "${new_version}" =~ "rc" ]]; then
|
||||||
|
## we're in a stable branch, coming from "rcX" (tagged as latest) and we're going
|
||||||
|
## to "rcX+1", which should still be tagged as latest.
|
||||||
|
version_to_replace="latest"
|
||||||
replacement="latest"
|
replacement="latest"
|
||||||
fi
|
fi
|
||||||
version_to_replace="latest"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${version_to_replace}" != "${replacement}" ]; then
|
if [ "${version_to_replace}" != "${replacement}" ] || [ "${removed_files}" == "true" ]; then
|
||||||
## this covers case 2) and 3), as on both of them we have changes on kata-deploy / kata-cleanup files
|
## this covers case 3), as it has changes on kata-deploy / kata-cleanup files
|
||||||
sed -i "s#${registry}:${version_to_replace}#${registry}:${new_version}#g" "${kata_deploy_yaml}"
|
sed -i "s#${registry}:${version_to_replace}#${registry}:${replacement}#g" "${kata_deploy_yaml}"
|
||||||
sed -i "s#${registry}:${version_to_replace}#${registry}:${new_version}#g" "${kata_cleanup_yaml}"
|
sed -i "s#${registry}:${version_to_replace}#${registry}:${replacement}#g" "${kata_cleanup_yaml}"
|
||||||
|
|
||||||
git diff
|
git diff
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user