mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-22 22:21:10 +02:00
Merge pull request #237 from flatcar-linux/t-lo/container-builds-update-version-in-main-branch
ci-automation: SDK build updates version.txt in main branch
This commit is contained in:
commit
1b4022d237
@ -48,6 +48,7 @@ function update_submodules() {
|
|||||||
|
|
||||||
function update_and_push_version() {
|
function update_and_push_version() {
|
||||||
local version="$1"
|
local version="$1"
|
||||||
|
local push_to_branch="${2:-false}"
|
||||||
|
|
||||||
# set up author and email so git does not complain when tagging
|
# set up author and email so git does not complain when tagging
|
||||||
if ! git config --get user.name >/dev/null 2>&1 ; then
|
if ! git config --get user.name >/dev/null 2>&1 ; then
|
||||||
@ -71,8 +72,9 @@ function update_and_push_version() {
|
|||||||
|
|
||||||
git tag -f "${TAG_ARGS[@]}" "${version}"
|
git tag -f "${TAG_ARGS[@]}" "${version}"
|
||||||
|
|
||||||
if [ "${PUSH-0}" = 1 ]; then
|
if [ "${push_to_branch}" = "true" ]; then
|
||||||
git push
|
local branch="$(git rev-parse --abbrev-ref HEAD)"
|
||||||
|
git push origin "${branch}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if git push origin "${version}" ; then
|
if git push origin "${version}" ; then
|
||||||
|
@ -84,7 +84,17 @@ function sdk_bootstrap() {
|
|||||||
copy_to_buildcache "sdk/${ARCH}/${vernum}" "${dest_tarball}"*
|
copy_to_buildcache "sdk/${ARCH}/${vernum}" "${dest_tarball}"*
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
# Create new tag in scripts repo w/ updated versionfile + submodules
|
# Create new tag in scripts repo w/ updated versionfile + submodules.
|
||||||
update_and_push_version "sdk-${git_vernum}"
|
# Also push the changes to the branch ONLY IF we're doing a nightly
|
||||||
|
# build of the 'main' branch AND we're definitely ON the main branch
|
||||||
|
# (`scripts` and submodules).
|
||||||
|
local push_branch="false"
|
||||||
|
if [[ "${version}" =~ ^main-[0-9.]+-nightly-[-0-9]+$ ]] \
|
||||||
|
&& [ "$(git rev-parse --abbrev-ref HEAD)" = "main" ] \
|
||||||
|
&& [ "$(git -C sdk_container/src/third_party/coreos-overlay/ rev-parse --abbrev-ref HEAD)" = "main" ] \
|
||||||
|
&& [ "$(git -C sdk_container/src/third_party/portage-stable/ 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