mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-08 05:26:58 +02:00
ci-automation: Push version file early
When a nightly build is started that pushes the version file to the branch it was doing so only at the end of the build, causing the push to fail if something else got merged in between. Push the version file early by generating it the same way it would be generated by the run_sdk_container/bootstrap_sdk_container scripts. In the case of the SDK the version file gets the same version for the OS and the SDK. Add some explanations about the version formats. Note that the scripts will still rewrite the file but it should be a no-op.
This commit is contained in:
parent
95367851fa
commit
cee8a6aadf
@ -122,6 +122,13 @@ function packages_build() {
|
|||||||
local docker_vernum="$(vernum_to_docker_image_version "${vernum}")"
|
local docker_vernum="$(vernum_to_docker_image_version "${vernum}")"
|
||||||
local packages_container="flatcar-packages-${arch}-${docker_vernum}"
|
local packages_container="flatcar-packages-${arch}-${docker_vernum}"
|
||||||
|
|
||||||
|
# Create version file
|
||||||
|
(
|
||||||
|
source sdk_lib/sdk_container_common.sh
|
||||||
|
create_versionfile "$sdk_version" "$version"
|
||||||
|
)
|
||||||
|
update_and_push_version "${version}" "${push_branch}"
|
||||||
|
|
||||||
# Build packages; store packages and torcx output in container
|
# Build packages; store packages and torcx output in container
|
||||||
./run_sdk_container -x ./ci-cleanup.sh -n "${packages_container}" -v "${version}" \
|
./run_sdk_container -x ./ci-cleanup.sh -n "${packages_container}" -v "${version}" \
|
||||||
-C "${sdk_image}" \
|
-C "${sdk_image}" \
|
||||||
@ -154,7 +161,5 @@ function packages_build() {
|
|||||||
"${torcx_tmp}/torcx/${arch}-usr/latest/torcx_manifest.json"
|
"${torcx_tmp}/torcx/${arch}-usr/latest/torcx_manifest.json"
|
||||||
copy_to_buildcache "images/${arch}/${vernum}/torcx" \
|
copy_to_buildcache "images/${arch}/${vernum}/torcx" \
|
||||||
"${torcx_tmp}/torcx/pkgs/${arch}-usr/docker/"*/*.torcx.tgz
|
"${torcx_tmp}/torcx/pkgs/${arch}-usr/docker/"*/*.torcx.tgz
|
||||||
|
|
||||||
update_and_push_version "${version}" "${push_branch}"
|
|
||||||
}
|
}
|
||||||
# --
|
# --
|
||||||
|
@ -100,18 +100,23 @@ function sdk_bootstrap() {
|
|||||||
local vernum="${version#*-}" # remove alpha-,beta-,stable-,lts- version tag
|
local vernum="${version#*-}" # remove alpha-,beta-,stable-,lts- version tag
|
||||||
local git_vernum="${vernum}"
|
local git_vernum="${vernum}"
|
||||||
|
|
||||||
# This will update FLATCAR_VERSION[_ID] and BUILD_ID in versionfile
|
# Update FLATCAR_VERSION[_ID], BUILD_ID, and SDK in versionfile
|
||||||
|
(
|
||||||
|
source sdk_lib/sdk_container_common.sh
|
||||||
|
create_versionfile "${vernum}"
|
||||||
|
)
|
||||||
|
update_and_push_version "${version}" "${push_branch}"
|
||||||
|
|
||||||
./bootstrap_sdk_container -x ./ci-cleanup.sh "${seed_version}" "${vernum}"
|
./bootstrap_sdk_container -x ./ci-cleanup.sh "${seed_version}" "${vernum}"
|
||||||
|
|
||||||
# push SDK tarball to buildcache
|
# push SDK tarball to buildcache
|
||||||
|
# Get Flatcar version number format (separator is '+' instead of '-',
|
||||||
|
# equal to $(strip_version_prefix "$version")
|
||||||
source sdk_container/.repo/manifests/version.txt
|
source sdk_container/.repo/manifests/version.txt
|
||||||
local vernum="${FLATCAR_SDK_VERSION}"
|
local dest_tarball="flatcar-sdk-${ARCH}-${FLATCAR_SDK_VERSION}.tar.bz2"
|
||||||
local dest_tarball="flatcar-sdk-${ARCH}-${vernum}.tar.bz2"
|
|
||||||
|
|
||||||
cd "__build__/images/catalyst/builds/flatcar-sdk"
|
cd "__build__/images/catalyst/builds/flatcar-sdk"
|
||||||
copy_to_buildcache "sdk/${ARCH}/${vernum}" "${dest_tarball}"*
|
copy_to_buildcache "sdk/${ARCH}/${FLATCAR_SDK_VERSION}" "${dest_tarball}"*
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
update_and_push_version "${version}" "${push_branch}"
|
|
||||||
}
|
}
|
||||||
# --
|
# --
|
||||||
|
Loading…
Reference in New Issue
Block a user