mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-04 19:56:32 +02:00
ci-automation: SDK build updates version.txt in main branch
This change has sdk_bootstrap update the origin branch when run from the main branch, updating the SDK and OS version in 'main' for each SDK bootstrap build. Release / maintenance branches have the SDK version set in the versionfile at release time. But main is never updated. Updating the versionfile in main when a new SDK is built ensures that dev branches based on main will also use the correct SDK version (e.g. in subsequent CI builds).
This commit is contained in:
parent
75b7fd1038
commit
c1f4dcc4a4
@ -49,6 +49,7 @@ function update_submodules() {
|
||||
|
||||
function update_and_push_version() {
|
||||
local version="$1"
|
||||
local push_to_branch="${2:-false}"
|
||||
|
||||
# set up author and email so git does not complain when tagging
|
||||
if ! git config --get user.name >/dev/null 2>&1 ; then
|
||||
@ -72,8 +73,9 @@ function update_and_push_version() {
|
||||
|
||||
git tag -f "${TAG_ARGS[@]}" "${version}"
|
||||
|
||||
if [ "${PUSH-0}" = 1 ]; then
|
||||
git push
|
||||
if [ "${push_to_branch}" = "true" ]; then
|
||||
local branch="$(git rev-parse --abbrev-ref HEAD)"
|
||||
git push origin "${branch}"
|
||||
fi
|
||||
|
||||
if git push origin "${version}" ; then
|
||||
|
||||
@ -84,7 +84,13 @@ function sdk_bootstrap() {
|
||||
copy_to_buildcache "sdk/${ARCH}/${vernum}" "${dest_tarball}"*
|
||||
cd -
|
||||
|
||||
# Create new tag in scripts repo w/ updated versionfile + submodules
|
||||
update_and_push_version "sdk-${git_vernum}"
|
||||
# Create new tag in scripts repo w/ updated versionfile + submodules.
|
||||
# When on the 'main' branch then also push to the branch so the versionfile
|
||||
# and git submodules stay up to date.
|
||||
local push_branch="false"
|
||||
if [ "$(git rev-parse --abbrev-ref HEAD)" = "main" ] ; then
|
||||
push_branch="true"
|
||||
fi
|
||||
update_and_push_version "sdk-${git_vernum}" "${push_branch}"
|
||||
}
|
||||
# --
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user