Merge pull request #83 from jcvenegas/kernel-tag

release: tag: tag kernel build
This commit is contained in:
Jose Carlos Venegas Munoz 2018-07-04 12:52:03 -05:00 committed by GitHub
commit 5bdad695b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,25 +86,30 @@ tag_repos() {
info "Creating tag ${kata_version} in all repos" info "Creating tag ${kata_version} in all repos"
for repo in "${repos[@]}"; do for repo in "${repos[@]}"; do
git clone --quiet "https://github.com/${OWNER}/${repo}.git" git clone --quiet "https://github.com/${OWNER}/${repo}.git"
pushd "${repo}" pushd "${repo}" >> /dev/null
git remote set-url --push origin "git@github.com:${OWNER}/${repo}.git" git remote set-url --push origin "git@github.com:${OWNER}/${repo}.git"
git fetch origin --tags git fetch origin --tags
if git rev-parse -q --verify "refs/tags/${kata_version}"; then tag="$kata_version"
[[ "packaging" == "${repo}" ]] && tag="${tag}-kernel-config"
if git rev-parse -q --verify "refs/tags/${tag}"; then
info "$repo already has tag " info "$repo already has tag "
else else
info "Creating tag ${kata_version} for ${repo}" info "Creating tag ${tag} for ${repo}"
git tag -a "${kata_version}" -s -m "${PROJECT} release ${kata_version}" git tag -a "${tag}" -s -m "${PROJECT} release ${tag}"
fi fi
popd popd >> /dev/null
done done
} }
push_tags() { push_tags() {
info "Pushing tags to repos" info "Pushing tags to repos"
for repo in "${repos[@]}"; do for repo in "${repos[@]}"; do
pushd "${repo}" pushd "${repo}" >> /dev/null
git push origin "${kata_version}" tag="$kata_version"
popd [[ "packaging" == "${repo}" ]] && tag="${tag}-kernel-config"
info "Creating tag ${tag} for ${repo}"
git push origin "${tag}"
popd >> /dev/null
done done
} }
@ -120,7 +125,7 @@ subcmd=${1:-""}
[ -z "${subcmd}" ] && usage && exit 0 [ -z "${subcmd}" ] && usage && exit 0
pushd "${tmp_dir}" pushd "${tmp_dir}" >> /dev/null
case "${subcmd}" in case "${subcmd}" in
status) status)
@ -131,6 +136,7 @@ tag)
# Tag versions that does not have VERSIONS file # Tag versions that does not have VERSIONS file
# But we want to know the version compatible with a kata release. # But we want to know the version compatible with a kata release.
repos+=("tests") repos+=("tests")
repos+=("packaging")
tag_repos tag_repos
if [ "${PUSH}" == "true" ]; then if [ "${PUSH}" == "true" ]; then
push_tags push_tags
@ -144,4 +150,4 @@ tag)
esac esac
popd popd >> /dev/null