mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-11 15:16:21 +02:00
This searches for portage logs and configure logs after a build, and uploads them to bincache. This is currently only done for SDK builds, SDK container builds and package builds. This probably could be extended to catch logs for sysext builds, but this was annoying to implement, IIRC. Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
50 lines
1.4 KiB
Bash
Executable File
50 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Script used in Dockerfile.sdk-build. The failure is indicated by the
|
|
# BUILD_PACKAGES_FAILED file in the scripts directory in the built
|
|
# docker image. We do it to be able to recover the build logs from
|
|
# failed builds too.
|
|
|
|
set -euo pipefail
|
|
|
|
phase=${1}; shift
|
|
case ${phase} in
|
|
|
|
start)
|
|
binhost=${1}; shift
|
|
if ! ( ./setup_board --board="arm64-usr" --binhost="${binhost}/arm64-usr" && \
|
|
./setup_board --board="arm64-usr" --regen_configs && \
|
|
./build_packages --board="arm64-usr" --only_resolve_circular_deps && \
|
|
\
|
|
./setup_board --board="amd64-usr" --binhost="${binhost}/amd64-usr" && \
|
|
./setup_board --board="amd64-usr" --regen_configs && \
|
|
./build_packages --board="amd64-usr" --only_resolve_circular_deps ); then
|
|
touch BUILD_PACKAGES_FAILED
|
|
fi
|
|
exit 0
|
|
;;
|
|
|
|
finish)
|
|
logdir=''
|
|
if [[ ${#} -gt 0 ]]; then
|
|
logdir=${1}; shift
|
|
fi
|
|
if [[ -n ${logdir} ]]; then
|
|
for arch in amd64 arm64; do
|
|
cp -a "/build/${arch}-usr/var/log/portage" "${logdir}/${arch}-package-logs"
|
|
done
|
|
fi
|
|
if [[ -e BUILD_PACKAGES_FAILED ]]; then
|
|
rm -f BUILD_PACKAGES_FAILED
|
|
exit 1
|
|
fi
|
|
exit 0
|
|
;;
|
|
|
|
*)
|
|
echo "wrong phase ${phase@Q}" >&2
|
|
exit 1
|
|
;;
|
|
|
|
esac
|