mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-09 22:16:58 +02:00
Merge pull request #215 from flatcar-linux/t-lo/enable-nightly-build-binpkgs
SDK container: enable binpkg cache for nightly builds
This commit is contained in:
commit
0bc166c560
@ -147,7 +147,7 @@ get_board_binhost() {
|
|||||||
if [[ "${FLATCAR_BUILD_ID}" =~ ^nightly-.*$ ]] ; then
|
if [[ "${FLATCAR_BUILD_ID}" =~ ^nightly-.*$ ]] ; then
|
||||||
# containerised nightly build; this uses [VERSION]-[BUILD_ID] for binpkg url
|
# containerised nightly build; this uses [VERSION]-[BUILD_ID] for binpkg url
|
||||||
# and toolchain packages are at the same location as OS image ones
|
# and toolchain packages are at the same location as OS image ones
|
||||||
set -- "${FLATCAR_VERSION_ID}-${FLATCAR_BUILD_ID}"
|
set -- "${FLATCAR_VERSION_ID}+${FLATCAR_BUILD_ID}"
|
||||||
pkgs_include_toolchain=1
|
pkgs_include_toolchain=1
|
||||||
else
|
else
|
||||||
set -- "${FLATCAR_VERSION_ID}"
|
set -- "${FLATCAR_VERSION_ID}"
|
||||||
@ -189,7 +189,12 @@ get_sdk_binhost() {
|
|||||||
set -- "${FLATCAR_SDK_VERSION}"
|
set -- "${FLATCAR_SDK_VERSION}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FLATCAR_DEV_BUILDS_SDK="${FLATCAR_DEV_BUILDS_SDK-$FLATCAR_DEV_BUILDS/sdk}"
|
if [ "${FLATCAR_DEV_BUILDS}" != "${SETTING_BINPKG_SERVER_DEV_CONTAINERISED}" ] ; then
|
||||||
|
FLATCAR_DEV_BUILDS_SDK="${FLATCAR_DEV_BUILDS_SDK-${FLATCAR_DEV_BUILDS}/sdk}"
|
||||||
|
else
|
||||||
|
# ALWAYS use a released SDK version, never a nightly, for SDK binpkgs
|
||||||
|
FLATCAR_DEV_BUILDS_SDK="${FLATCAR_DEV_BUILDS_SDK-${SETTING_BINPKG_SERVER_PROD}/sdk}"
|
||||||
|
fi
|
||||||
for ver in "$@"; do
|
for ver in "$@"; do
|
||||||
# Usually only crossdev needs to be fetched from /toolchain/ in the setup_board step.
|
# Usually only crossdev needs to be fetched from /toolchain/ in the setup_board step.
|
||||||
# The entry for /pkgs/ is there if something needs to be reinstalled in the SDK
|
# The entry for /pkgs/ is there if something needs to be reinstalled in the SDK
|
||||||
|
@ -15,24 +15,31 @@ chown -R sdk:sdk /home/sdk
|
|||||||
(
|
(
|
||||||
source /etc/lsb-release # SDK version in DISTRIB_RELEASE
|
source /etc/lsb-release # SDK version in DISTRIB_RELEASE
|
||||||
source /mnt/host/source/.repo/manifests/version.txt # OS image version in FLATCAR_VERSION_ID
|
source /mnt/host/source/.repo/manifests/version.txt # OS image version in FLATCAR_VERSION_ID
|
||||||
|
version="${FLATCAR_VERSION_ID}"
|
||||||
|
|
||||||
if [ "${FLATCAR_VERSION_ID}" != "${DISTRIB_RELEASE}" ] ; then
|
# If this is a nightly build tag we can use pre-built binaries directly from the
|
||||||
|
# build cache.
|
||||||
|
if [[ "${FLATCAR_BUILD_ID}" =~ ^nightly-.*$ ]] ; then
|
||||||
|
version="${FLATCAR_VERSION_ID}+${FLATCAR_BUILD_ID}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${version}" != "${DISTRIB_RELEASE}" ] ; then
|
||||||
for target in amd64-usr arm64-usr; do
|
for target in amd64-usr arm64-usr; do
|
||||||
if [ ! -d "/build/$target" ] ; then
|
if [ ! -d "/build/$target" ] ; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
if [ -f "/build/$target/etc/target-version.txt" ] ; then
|
if [ -f "/build/$target/etc/target-version.txt" ] ; then
|
||||||
source "/build/$target/etc/target-version.txt"
|
source "/build/$target/etc/target-version.txt"
|
||||||
if [ "${TARGET_FLATCAR_VERSION_ID}" = "${FLATCAR_VERSION_ID}" ] ; then
|
if [ "${TARGET_FLATCAR_VERSION}" = "${version}" ] ; then
|
||||||
continue # already updated
|
continue # already updated
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Updating board support in '/build/${target}' to use package cache for version '${FLATCAR_VERSION_ID}'"
|
echo "Updating board support in '/build/${target}' to use package cache for version '${version}'"
|
||||||
echo "---"
|
echo "---"
|
||||||
sudo su sdk -l -c "/home/sdk/trunk/src/scripts/setup_board --board='$target' --regen_configs_only"
|
sudo su sdk -l -c "/home/sdk/trunk/src/scripts/setup_board --board='$target' --regen_configs_only"
|
||||||
echo "TARGET_FLATCAR_VERSION_ID='${FLATCAR_VERSION_ID}'" | sudo tee "/build/$target/etc/target-version.txt" >/dev/null
|
echo "TARGET_FLATCAR_VERSION='${version}'" | sudo tee "/build/$target/etc/target-version.txt" >/dev/null
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user