add autobuilder to server scripts

This commit is contained in:
Tobias Powalowski 2024-07-23 19:36:18 +02:00
parent 1319910db0
commit d9219a206f
3 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,6 @@
[Unit]
Description=Check, build and upload archboot images at night
[Service]
ExecStart=/home/tobias/Arch/iso/chroots/trigger-update.sh

View file

@ -0,0 +1,11 @@
[Unit]
Description=Runs trigger-update.sh at night
[Timer]
# Run everday at 2:00 night
OnCalendar=*-*-* 2:00:00
Unit=archboot.service
Persistent=true
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,16 @@
#!/bin/bash
_ARCH="x86_64 aarch64 riscv64"
_PACKAGES="archboot bcachefs-tools btrfs-progs e2fsprogs glibc linux systemd openssh ttyd xfsprogs"
_CHROOTS="/home/tobias/Arch/iso/chroots"
cd "${_CHROOTS}" || exit 1
for i in ${_ARCH}; do
systemd-nspawn -q -D "${i}" pacman --noconfirm -Syu
for k in ${_PACKAGES}; do
if rg -qw "${k}" "${i}"/var/log/pacman.log; then
archboot-"${i}"-server-release.sh
break
fi
done
rm "${i}"/var/log/pacman.log
done
# vim: set ft=sh ts=4 sw=4 et: