mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 22:51:03 +02:00
tag_release: by default, prompt before pushing
This commit is contained in:
parent
7ec72c7f88
commit
463d191d6b
21
tag_release
21
tag_release
@ -4,6 +4,22 @@
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
git_confirm() {
|
||||
local response
|
||||
if [[ ${FLAGS_force} -ne ${FLAGS_TRUE} ]]; then
|
||||
echo "Executing: git $@"
|
||||
while [[ "${response}" != "y" ]]; do
|
||||
echo -n "Proceed? (y/n) "
|
||||
read response
|
||||
if [[ "${response}" == "n" ]]; then
|
||||
echo "Aborting."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
git "$@"
|
||||
}
|
||||
|
||||
SCRIPT_ROOT=$(dirname $(readlink -f "$0"))
|
||||
. "${SCRIPT_ROOT}/common.sh" || exit 1
|
||||
|
||||
@ -38,6 +54,7 @@ DEFINE_boolean branch ${DEFAULT_BRANCH} "Release branch, diverge from master"
|
||||
DEFINE_string branch_projects "${DEFAULT_BRANCH_PROJECTS}" \
|
||||
"Branch the named projects (with a 'coreos/' prefix) in the manifest."
|
||||
DEFINE_boolean push ${FLAGS_FALSE} "Push to public manifest repository."
|
||||
DEFINE_boolean force ${FLAGS_FALSE} "Don't prompt before pushing."
|
||||
DEFINE_string remote "origin" "Remote name or URL to push to."
|
||||
DEFINE_string signer '' "Alternate GPG key ID used to sign the tag."
|
||||
|
||||
@ -151,7 +168,7 @@ if [[ -n "${FLAGS_branch_projects}" ]]; then
|
||||
for project in ${FLAGS_branch_projects}; do
|
||||
info=$(sed -n 's,.* name="coreos/'${project}'".* path="\([^"]*\)".* revision="\([0-9A-Fa-f]*\)".*,\2 \1,p' release.xml)
|
||||
info "Creating branch ${BRANCH_NAME} at ${info%% *} in ${project}"
|
||||
git -C "${REPO_ROOT}/${info#* }" push "${remote}" "${info%% *}:refs/heads/${BRANCH_NAME}"
|
||||
git_confirm -C "${REPO_ROOT}/${info#* }" push "${remote}" "${info%% *}:refs/heads/${BRANCH_NAME}"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
@ -163,7 +180,7 @@ if [[ ${FLAGS_push} -eq ${FLAGS_TRUE} ]]; then
|
||||
fi
|
||||
|
||||
info 'Pushing manifest updates'
|
||||
git push "${FLAGS_remote}" $master \
|
||||
git_confirm push "${FLAGS_remote}" $master \
|
||||
"refs/heads/${BRANCH_NAME}" \
|
||||
"refs/tags/${TAG_NAME}"
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user