diff options
Diffstat (limited to 'builders/milou/binhost-update')
-rwxr-xr-x | builders/milou/binhost-update | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/builders/milou/binhost-update b/builders/milou/binhost-update index 8a304dd..d48e15e 100755 --- a/builders/milou/binhost-update +++ b/builders/milou/binhost-update @@ -113,15 +113,26 @@ emerge --sync -q &>> ${TMPFILE} anyfail=0 +nspawn_command=(systemd-nspawn --bind /var/cache/distfiles --bind-ro /var/db/repos/gentoo --tmpfs=/var/tmp:mode=1777,size=${TMPFS_SIZE}g) for n in ${NSPAWN_NAMES} ; do + machinedir=/var/lib/machines/${n} echo Machine ${n} &>> ${TMPFILE} echo &>> ${TMPFILE} - cd /var/lib/machines/${n}/etc/binhost &>> ${TMPFILE} + cd ${machinedir}/etc/binhost &>> ${TMPFILE} git reset --hard &>> ${TMPFILE} git pull &>> ${TMPFILE} cd /root &>> ${TMPFILE} - systemd-nspawn --bind /var/cache/distfiles --bind-ro /var/db/repos/gentoo --tmpfs=/var/tmp:mode=1777,size=${TMPFS_SIZE}g -M ${n} /root/bin/run-update &>> ${TMPFILE} - let "anyfail+=$?" + "${nspawn_command[@]}" -M ${n} /root/bin/run-update &>> ${TMPFILE} + ret=$? + let "anyfail+=${ret}" + if [[ ${ret} = 0 ]]; then + builder=$(readlink ${machinedir}/etc/portage) + for variant in ${machinedir}/${builder}/variants/*; do + [[ -d ${variant} ]] || break + "${nspawn_command[@]}" --ephemeral --bind ${machinedir}/var/cache/binpkgs -M ${n} /root/bin/run-update ${variant##*/} &>> ${TMPFILE} + let "anyfail+=$?" + done + fi done |