mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-23 01:37:27 +00:00
Merge pull request #745 from jcvenegas/release-1.9-improvments
Release 1.9 improvements
This commit is contained in:
@@ -36,6 +36,10 @@ 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
|
||||
@@ -91,15 +95,19 @@ bump_repo() {
|
||||
git checkout "origin/${target_branch}" -b "${branch}"
|
||||
|
||||
# All repos we build should have a VERSION file
|
||||
[ -f "VERSION" ] || die "VERSION file not found "
|
||||
current_version="$(cat ./VERSION | grep -v '#')"
|
||||
if [ ! -f "VERSION" ]; then
|
||||
current_version="new"
|
||||
echo "${new_version}" >VERSION
|
||||
else
|
||||
current_version="$(grep -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
|
||||
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
|
||||
fi
|
||||
|
||||
info "Creating PR message"
|
||||
@@ -112,7 +120,15 @@ $(get_changes "$current_version")
|
||||
EOT
|
||||
cat "${notes_file}"
|
||||
|
||||
git add -u
|
||||
if (echo "${current_version}" | grep "alpha") && (echo "${new_version}" | grep -v "alpha");then
|
||||
info "update move from alpha, check if new version is rc0"
|
||||
if echo "$new_version" | grep -v "rc0"; then
|
||||
die "bump should be from alph to rc0"
|
||||
fi
|
||||
info "OK"
|
||||
fi
|
||||
|
||||
git add VERSION
|
||||
info "Creating commit with new changes"
|
||||
commit_msg="$(generate_commit $new_version $current_version)"
|
||||
git commit -s -m "${commit_msg}"
|
||||
@@ -147,14 +163,15 @@ EOT
|
||||
exit "$exit_code"
|
||||
}
|
||||
|
||||
# The tests repository is not included due to does not provide VERSION file.
|
||||
repos=(
|
||||
"agent"
|
||||
"ksm-throttler"
|
||||
"osbuilder"
|
||||
"packaging"
|
||||
"proxy"
|
||||
"runtime"
|
||||
"shim"
|
||||
"tests"
|
||||
)
|
||||
|
||||
main(){
|
||||
@@ -167,15 +184,6 @@ main(){
|
||||
|
||||
shift $((OPTIND - 1))
|
||||
|
||||
declare -A bump_stable
|
||||
# ksm-throttler is a project with low activity
|
||||
# Also it has low interdependency with other Kata projects.
|
||||
# Lets keep this as a single branch to simplify maintenance.
|
||||
bump_stable[ksm-throttler]=no
|
||||
# The image format is not likely to happen, unless a breaking change happens
|
||||
# If image format breaks Kata major version should change 1.X to 2.X
|
||||
# Lets keep this as a single branch to simplify maintenance.
|
||||
bump_stable[osbuilder]=no
|
||||
|
||||
new_version=${1:-}
|
||||
target_branch=${2:-}
|
||||
@@ -183,11 +191,6 @@ main(){
|
||||
[ -n "${target_branch}" ] || die "no target branch"
|
||||
for repo in "${repos[@]}"
|
||||
do
|
||||
echo "Bump ${repo} has stable : ${bump_stable[$repo]:-yes}"
|
||||
if [ ${bump_stable[$repo]:-yes} == "no" ] && [[ ${target_branch} =~ .*stable-.* ]] ;then
|
||||
echo "Not stable branch supported"
|
||||
continue
|
||||
fi
|
||||
pushd "$tmp_dir" >>/dev/null
|
||||
bump_repo "${repo}" "${new_version}" "${target_branch}"
|
||||
popd >>/dev/null
|
||||
|
Reference in New Issue
Block a user