diff options
author | Nicolas Dechesne <nicolas.dechesne@linaro.org> | 2019-05-24 11:37:01 +0200 |
---|---|---|
committer | Nicolas Dechesne <nicolas.dechesne@linaro.org> | 2019-05-27 09:59:16 +0000 |
commit | fa88e20fae98e0a1e2b294cb3f80a9948fcfd5c0 (patch) | |
tree | 086321992a4b83b2202ca6c5d4a9ba49e362d5b6 /fai | |
parent | ce2451fddcdf0fa86e603fd48922449523256f24 (diff) |
fai-test: add new job
This is a job so that we can test FAI patches before committing them,
to test if FAI works for all the supported arch.
Change-Id: I0d43aabbe2c64460aebaabd8e97da744e495803d
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Diffstat (limited to 'fai')
-rw-r--r-- | fai/builders.sh | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/fai/builders.sh b/fai/builders.sh new file mode 100644 index 00000000..52765e07 --- /dev/null +++ b/fai/builders.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +set -e + +trap cleanup_exit INT TERM EXIT + +cleanup_exit() +{ + echo "INFO: umount ${WORKSPACE}/builddir" + sudo umount ${WORKSPACE}/builddir +} + +if ! sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 update; then + echo "INFO: apt update error - try again in a moment" + sleep 15 + sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 update || true +fi +pkg_list="python-pip fai-server fai-setup-storage qemu-utils procps" +if ! sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 install -y ${pkg_list}; then + echo "INFO: apt install error - try again in a moment" + sleep 15 + sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 install -y ${pkg_list} +fi + +set -ex + +# speed up FAI +test -d builddir || mkdir builddir +sudo mount -t tmpfs -o size=6G tmpfs builddir + +# Get FAI config +git clone --depth 1 ${REPO_URL} -b ${BRANCH} fai + +cd fai + +git log -1 + +sudo fai-diskimage -v --cspace $(pwd) \ + --hostname linaro \ + -S ${ROOTFS_SIZE} \ + --class $(echo SAVECACHE,${FAI_CLASS} | tr '[:lower:]' '[:upper:]') \ + builddir/linaro-test-fai-${BUILD_NUMBER}.img.raw + +if grep -E '^(ERROR:|WARNING: These unknown packages are removed from the installation list|Exit code task_)' /var/log/fai/linaro/last/fai.log +then + echo "Errors during build" + exit 1 +fi |