From 4ef08dc2709c42fd5bf2fe453c06919fe01b8297 Mon Sep 17 00:00:00 2001 From: Delan Azabani Date: Wed, 1 Jan 2025 19:25:43 +0800 Subject: [PATCH] Check that Servo was built correctly when building images (#6) --- mount-runner.sh | 8 +++++++- ubuntu2204/build-image.sh | 5 +++-- windows10/build-image.sh | 5 +++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/mount-runner.sh b/mount-runner.sh index 5ccf987..441f584 100755 --- a/mount-runner.sh +++ b/mount-runner.sh @@ -18,5 +18,11 @@ else >&2 echo "fatal: failed to find $vm-part1 in /dev/zvol/$SERVO_CI_ZFS_PREFIX or /dev/zvol/$SERVO_CI_ZFS_CLONE_PREFIX" exit 1 fi -( cd $mount; "$@" || : ) +cd $mount +set +e +"$@" +retval=$? +set -e +cd - umount $mount +exit $retval diff --git a/ubuntu2204/build-image.sh b/ubuntu2204/build-image.sh index 63d52d4..731f656 100755 --- a/ubuntu2204/build-image.sh +++ b/ubuntu2204/build-image.sh @@ -71,10 +71,11 @@ if ! time virsh event --timeout 2000 -- "$image_name" lifecycle; then exit 1 fi +>&2 echo '[*] Checking that Servo was built correctly' +./mount-runner.sh "$image_name" sh -c 'ls init/built_servo_once_successfully' + snapshot=$(date -u +\%FT\%RZ) >&2 echo "[*] Taking zvol snapshot: $SERVO_CI_ZFS_CLONE_PREFIX/$image_name@build-image-$snapshot" zfs snapshot "$SERVO_CI_ZFS_CLONE_PREFIX/$image_name@build-image-$snapshot" -# TODO: check that servo was actually built correctly - >&2 echo '[*] Done!' diff --git a/windows10/build-image.sh b/windows10/build-image.sh index a4b505e..f44fe6a 100755 --- a/windows10/build-image.sh +++ b/windows10/build-image.sh @@ -68,10 +68,11 @@ if ! time virsh event --timeout 2500 -- "$image_name" lifecycle; then exit 1 fi +>&2 echo '[*] Checking that Servo was built correctly' +./mount-runner.sh "$image_name" sh -c 'ls -l init/built_servo_once_successfully' + snapshot=$(date -u +\%FT\%RZ) >&2 echo "[*] Taking zvol snapshot: $SERVO_CI_ZFS_CLONE_PREFIX/$image_name@build-image-$snapshot" zfs snapshot "$SERVO_CI_ZFS_CLONE_PREFIX/$image_name@build-image-$snapshot" -# TODO: check that servo was actually built correctly - >&2 echo '[*] Done!'