mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-22 12:29:49 +00:00
Let's teach our `update-repository-version.sh` script to properly update the kata-deploy tags on both kata-deploy and kata-cleanup yaml files. The 3 scenarios that we're dealing with, based on which branch we're targetting, are: ``` 1) [main] ------> [main] NO-OP "alpha0" "alpha1" +----------------+----------------+ | from | to | -----------------+----------------+----------------+ kata-deploy | "latest" | "latest" | -----------------+----------------+----------------+ kata-deploy-base | "stable | "stable" | -----------------+----------------+----------------+ 2) [main] ------> [stable] Update kata-deploy and "alpha2" "rc0" get rid of kata-deploy-base +----------------+----------------+ | from | to | -----------------+----------------+----------------+ kata-deploy | "latest" | "rc0" | -----------------+----------------+----------------+ kata-deploy-base | "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 | -----------------+----------------+----------------+ ``` And we can easily cover those 3 cases only with the information about the "${target_branch}" and the "${new_version}", where: * case 1) if "${target_branch}" is "main" *and* "${new_version}" contains "alpha", do nothing * case 2) if "${target_branch}" is "main" *and* "${new_version}" contains "rc": * change the kata-deploy & kata-cleanup tags from "latest" to "${new_version}". * delete the kata-deploy-stable & kata-cleanup-stable files. * case 3) if the "${target_branch}" contains "stable": * change the kata-deploy & kata-cleanup tags from "${current_version}" to "${new_version}". Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>