From e85a16fe1cebe0e4eeea1160f052b8215629a547 Mon Sep 17 00:00:00 2001 From: Kai Lueke Date: Wed, 5 Jan 2022 14:21:08 +0100 Subject: [PATCH] ci-automation: allow to optionally push and sign the commit For test builds the commit that updates the submodules can be free- standing but for releases we need to push it to the branch and also sign the tag. Add optional arguments that are used by the tag-release script in flatcar-build-scripts. --- ci-automation/ci_automation_common.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ci-automation/ci_automation_common.sh b/ci-automation/ci_automation_common.sh index e876466d83..9818f147f1 100644 --- a/ci-automation/ci_automation_common.sh +++ b/ci-automation/ci_automation_common.sh @@ -61,7 +61,16 @@ function update_and_push_version() { git commit --allow-empty -m "New version: ${version}" - git tag -f "${version}" + local -a TAG_ARGS + if [ "${SIGN-0}" = 1 ]; then + TAG_ARGS=("-s" "-m" "${version}") + fi + + git tag -f "${TAG_ARGS[@]}" "${version}" + + if [ "${PUSH-0}" = 1 ]; then + git push + fi if git push origin "${version}" ; then return