mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-20 00:07:55 +00:00
Merge pull request #614 from GabyCT/topic/updatecheckversion
ci: Enable check VERSION among the components without the runtime
This commit is contained in:
@@ -40,6 +40,7 @@ EOT
|
|||||||
|
|
||||||
Args:
|
Args:
|
||||||
status : Get Current ${PROJECT} tags status
|
status : Get Current ${PROJECT} tags status
|
||||||
|
pre-release : Takes a version to check all the components match with it (but not the runtime)
|
||||||
tag : Create tags for ${PROJECT}
|
tag : Create tags for ${PROJECT}
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
@@ -90,12 +91,26 @@ not_stable_branch=(
|
|||||||
"ksm-throttler"
|
"ksm-throttler"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# The pre-release option at the check_versions function receives
|
||||||
|
# the runtime VERSION in order to check all the components match with it,
|
||||||
|
# this has the purpose that all the components have the same version before
|
||||||
|
# merging the runtime version
|
||||||
check_versions() {
|
check_versions() {
|
||||||
|
version_to_check=${1:-}
|
||||||
|
if [ -z "${version_to_check}" ];then
|
||||||
|
info "Query the version from latest runtime in branch ${branch}"
|
||||||
|
else
|
||||||
|
kata_version="${version_to_check}"
|
||||||
|
fi
|
||||||
|
|
||||||
info "Tagging ${PROJECT} with version ${kata_version}"
|
info "Tagging ${PROJECT} with version ${kata_version}"
|
||||||
info "Check all repos has version ${kata_version} in VERSION file"
|
info "Check all repos has version ${kata_version} in VERSION file"
|
||||||
|
|
||||||
for repo in "${repos[@]}"; do
|
for repo in "${repos[@]}"; do
|
||||||
|
if [ ! -z "${version_to_check}" ] && [ "${repo}" == "runtime" ]; then
|
||||||
|
info "Not checking runtime because we want the rest of repos are in ${version_to_check}"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
repo_version=$(curl -Ls "${URL_RAW_FILE}/${repo}/${branch}/VERSION" | grep -v -P "^#")
|
repo_version=$(curl -Ls "${URL_RAW_FILE}/${repo}/${branch}/VERSION" | grep -v -P "^#")
|
||||||
info "${repo} is in $repo_version"
|
info "${repo} is in $repo_version"
|
||||||
[ "${repo_version}" == "${kata_version}" ] || die "${repo} is not in version ${kata_version}"
|
[ "${repo_version}" == "${kata_version}" ] || die "${repo} is not in version ${kata_version}"
|
||||||
@@ -174,6 +189,7 @@ create_github_release() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
main () {
|
||||||
while getopts "b:hp" opt; do
|
while getopts "b:hp" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
b) branch="${OPTARG}" ;;
|
b) branch="${OPTARG}" ;;
|
||||||
@@ -184,6 +200,7 @@ done
|
|||||||
shift $((OPTIND - 1))
|
shift $((OPTIND - 1))
|
||||||
|
|
||||||
subcmd=${1:-""}
|
subcmd=${1:-""}
|
||||||
|
shift || true
|
||||||
kata_version=$(curl -Ls "${URL_RAW_FILE}/runtime/${branch}/VERSION" | grep -v -P "^#")
|
kata_version=$(curl -Ls "${URL_RAW_FILE}/runtime/${branch}/VERSION" | grep -v -P "^#")
|
||||||
|
|
||||||
[ -z "${subcmd}" ] && usage && exit 0
|
[ -z "${subcmd}" ] && usage && exit 0
|
||||||
@@ -194,6 +211,9 @@ case "${subcmd}" in
|
|||||||
status)
|
status)
|
||||||
check_versions
|
check_versions
|
||||||
;;
|
;;
|
||||||
|
pre-release)
|
||||||
|
check_versions ${1}
|
||||||
|
;;
|
||||||
tag)
|
tag)
|
||||||
check_versions
|
check_versions
|
||||||
repos+=("${repos_not_versions[@]}")
|
repos+=("${repos_not_versions[@]}")
|
||||||
@@ -211,3 +231,5 @@ tag)
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
popd >>/dev/null
|
popd >>/dev/null
|
||||||
|
}
|
||||||
|
main "$@"
|
||||||
|
@@ -20,3 +20,10 @@ echo "Check tag_repos.sh status"
|
|||||||
|
|
||||||
echo "Check tag_repos.sh create tags but not push"
|
echo "Check tag_repos.sh create tags but not push"
|
||||||
./release/tag_repos.sh tag | grep "tags not pushed"
|
./release/tag_repos.sh tag | grep "tags not pushed"
|
||||||
|
|
||||||
|
echo "Check tag_repos.sh pre-release"
|
||||||
|
./release/tag_repos.sh pre-release $(curl -sL https://raw.githubusercontent.com/kata-containers/runtime/master/VERSION) | grep "Not checking runtime"
|
||||||
|
|
||||||
|
echo "Check tag_repos.sh pre-release with invalid information"
|
||||||
|
./release/tag_repos.sh pre-release 1000000 | grep "ERROR" || true
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user