Support unattended mode for recipe releasing

This commit is contained in:
decentral1se 2021-06-03 10:06:40 +02:00
parent 0ff08b5d34
commit 3759bcd641
Signed by untrusted user who does not match committer: decentral1se
GPG Key ID: 92DAD76BD9567B8A

8
abra
View File

@ -2108,10 +2108,14 @@ sub_recipe_release() {
if [ "$(git rev-parse --abbrev-ref --symbolic-full-name HEAD)" = "HEAD" ]; then if [ "$(git rev-parse --abbrev-ref --symbolic-full-name HEAD)" = "HEAD" ]; then
warning "It looks like $recipe_dir is in 'detached HEAD' state" warning "It looks like $recipe_dir is in 'detached HEAD' state"
if [ "$abra___no_prompt" = "false" ]; then
read -rp "Check out main/master branch first? [Y/n] " read -rp "Check out main/master branch first? [Y/n] "
if [ "${choice,,}" != "n" ]; then if [ "${choice,,}" != "n" ]; then
checkout_main_or_master checkout_main_or_master
fi fi
else
checkout_main_or_master
fi
fi fi
mapfile -t extra_compose_files < <(ls -- compose.*.yml 2> /dev/null || true) mapfile -t extra_compose_files < <(ls -- compose.*.yml 2> /dev/null || true)
@ -2197,19 +2201,23 @@ sub_recipe_release() {
success "All compose files updated; new version is $new_version" success "All compose files updated; new version is $new_version"
if [ "$abra___no_prompt" = "false" ]; then
read -rp "Commit your changes to git? [y/N]? " choice read -rp "Commit your changes to git? [y/N]? " choice
if [ "${choice,,}" != "y" ]; then if [ "${choice,,}" != "y" ]; then
return return
fi fi
fi
git commit -avem "Version $new_version; sync labels" || exit git commit -avem "Version $new_version; sync labels" || exit
if [ "$abra___no_prompt" = "false" ]; then
read -rp "Tag this as \`$new_version\`? [y/N]? " choice read -rp "Tag this as \`$new_version\`? [y/N]? " choice
if [ "${choice,,}" != "y" ]; then if [ "${choice,,}" != "y" ]; then
return return
fi fi
fi
test "$force" = "true" && git tag -d "$new_version" test "$force" = "true" && git tag -d "$new_version"
git tag -aem "$latest_version_message" "$new_version" git tag -aem "$latest_version_message" "$new_version"