mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-29 08:47:56 +00:00
bump-repos: Bump all repos from script
Simplify the pipeline code by doing all the bumps. - Instead of get the repo to bump, make the script bump them all - Do not bump osbuilder and ksm on stable branches. - Simplify usage for automation. Fixes: #443 Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
This commit is contained in:
parent
2c624b12e1
commit
65e55a8b2c
@ -63,12 +63,7 @@ $ git pull
|
||||
$ cd ${GOPATH}/src/github.com/kata-containers/packaging/release
|
||||
$ export NEW_VERSION=X.Y.Z
|
||||
$ export BRANCH="master"
|
||||
$ ./update-repository-version.sh -p ksm-throttler "$NEW_VERSION" "$BRANCH"
|
||||
$ ./update-repository-version.sh -p proxy "$NEW_VERSION" "$BRANCH"
|
||||
$ ./update-repository-version.sh -p shim "$NEW_VERSION" "$BRANCH"
|
||||
$ ./update-repository-version.sh -p runtime "$NEW_VERSION" "$BRANCH"
|
||||
$ ./update-repository-version.sh -p osbuilder "$NEW_VERSION" "$BRANCH"
|
||||
$ ./update-repository-version.sh -p agent "$NEW_VERSION" "$BRANCH"
|
||||
$ ./update-repository-version.sh -p "$NEW_VERSION" "$BRANCH"
|
||||
```
|
||||
The commands from above will create a github pull request in the Kata projects.
|
||||
Work with the Kata approvers to verify that the CI works and the PR are merged.
|
||||
|
@ -119,7 +119,6 @@ usage() {
|
||||
Usage:
|
||||
${script_name} [options] <args>
|
||||
Args:
|
||||
<repository-name> : Name of repository to fork and send PR from github.com/${organization}
|
||||
<new-version> : New version to bump the repository
|
||||
<target-branch> : The base branch to create to PR
|
||||
Example:
|
||||
@ -131,22 +130,52 @@ EOT
|
||||
exit "$exit_code"
|
||||
}
|
||||
|
||||
while getopts "hp" opt; do
|
||||
case $opt in
|
||||
h) usage 0 ;;
|
||||
p) PUSH="true" ;;
|
||||
esac
|
||||
done
|
||||
# The tests repository is not included due to does not provide VERSION file.
|
||||
repos=(
|
||||
"agent"
|
||||
"ksm-throttler"
|
||||
"osbuilder"
|
||||
"proxy"
|
||||
"runtime"
|
||||
"shim"
|
||||
)
|
||||
|
||||
shift $((OPTIND - 1))
|
||||
|
||||
repo=${1:-}
|
||||
new_version=${2:-}
|
||||
target_branch=${3:-}
|
||||
[ -n "${repo}" ] || (echo "ERROR: repository not provided" && usage 1)
|
||||
[ -n "${new_version}" ] || (echo "ERROR: no new version" && usage 1)
|
||||
[ -n "${target_branch}" ] || die "no target branch"
|
||||
main(){
|
||||
while getopts "hp" opt; do
|
||||
case $opt in
|
||||
h) usage 0 ;;
|
||||
p) PUSH="true" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
pushd "$tmp_dir" >>/dev/null
|
||||
bump_repo "${repo}" "${new_version}" "${target_branch}"
|
||||
popd >>/dev/null
|
||||
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:-}
|
||||
[ -n "${new_version}" ] || { echo "ERROR: no new version" && usage 1; }
|
||||
[ -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
|
||||
done
|
||||
|
||||
}
|
||||
main $@
|
||||
|
@ -37,7 +37,7 @@ output_should_contain "${out}" "Usage"
|
||||
OK
|
||||
|
||||
echo "Missing version show help"
|
||||
out=$("${script_dir}/update-repository-version.sh" "runtime" 2>&1) || (($? != 0))
|
||||
out=$("${script_dir}/update-repository-version.sh" 2>&1) || (($? != 0))
|
||||
echo "${out}" | grep Usage >>/dev/null
|
||||
echo "${out}" | grep "no new version" >>/dev/null
|
||||
OK
|
||||
@ -49,6 +49,6 @@ OK
|
||||
|
||||
echo "Local update version update should work"
|
||||
new_version=50.0.0
|
||||
out=$("${script_dir}/update-repository-version.sh" "runtime" "${new_version}" "master" 2>&1)
|
||||
out=$("${script_dir}/update-repository-version.sh" "${new_version}" "master" 2>&1)
|
||||
output_should_contain "${out}" "release: Kata Containers ${new_version}"
|
||||
OK
|
||||
|
Loading…
Reference in New Issue
Block a user