amprolla

devuan's apt repo merger
git clone git://parazyd.org/amprolla.git
Log | Files | Refs | README | LICENSE

commit c65c85d66eca422c4aea2cdd2bd8d8e8c97981c6
parent 807cb3efadbdc2c7fe3bd0b4a66a4ac2be94eb6e
Author: parazyd <parazyd@dyne.org>
Date:   Sat,  9 Dec 2017 16:24:38 +0100

sync orchestrate.sh with prod

Diffstat:
Morchestrate.sh | 50++++++++++++++++++++++++++++++--------------------
1 file changed, 30 insertions(+), 20 deletions(-)

diff --git a/orchestrate.sh b/orchestrate.sh @@ -7,30 +7,40 @@ AMPROLLA_UPDATE="${AMPROLLA_UPDATE:-/srv/amprolla/amprolla_update.py}" REPO_ROOT="${REPO_ROOT:-/srv/amprolla}" -# TODO: Remove the while loop and run with cron after testing phase +[ -f "/run/lock/amprolla.lock" ] || { +ln -snf "$REPO_ROOT"/merged-staging "$REPO_ROOT"/merged +# The break call is temporary to catch unhandled exceptions in the testing phase +python3 "$AMPROLLA_UPDATE" || { + ln -snf "$REPO_ROOT"/merged-production "$REPO_ROOT"/merged +} -while true; do - [ -f "/tmp/amprolla.lock" ] || { - ln -snf "$REPO_ROOT"/merged-staging "$REPO_ROOT"/merged - # The break call is temporary to catch unhandled exceptions in the testing phase - python3 "$AMPROLLA_UPDATE" || { - ln -snf "$REPO_ROOT"/merged-production "$REPO_ROOT"/merged - break - } +printf "rsyncing volatile to production... " +rsync --delete -raX "$REPO_ROOT"/merged-volatile/* "$REPO_ROOT"/merged-production +printf "done!\n" - printf "rsyncing volatile to production... " - rsync --delete -raX "$REPO_ROOT"/merged-volatile/* "$REPO_ROOT"/merged-production - printf "done!\n" +ln -snf "$REPO_ROOT"/merged-production "$REPO_ROOT"/merged - ln -snf "$REPO_ROOT"/merged-production "$REPO_ROOT"/merged +printf "rsyncing volatile to staging... " +rsync --delete -raX "$REPO_ROOT"/merged-volatile/* "$REPO_ROOT"/merged-staging +printf "done!\n" - printf "rsyncing volatile to staging... " - rsync --delete -raX "$REPO_ROOT"/merged-volatile/* "$REPO_ROOT"/merged-staging - printf "done!\n" +printf "rsyncing production to pkgmaster... " +rsync --delete -raX \ + "$REPO_ROOT"/merged-production/ \ + mirror@pkgmaster.devuan.org:/home/mirror/devuan/merged +printf "done!\n" - # handle obsolete package logs - cat "$REPO_ROOT"/log/*-oldpackages.txt | sort | uniq > "$REPO_ROOT"/log/oldpackages.txt - } +# handle obsolete package logs +cat "$REPO_ROOT"/log/*-oldpackages.txt | sort | uniq > "$REPO_ROOT"/log/oldpackages.txt - sleep 3600 +_logfiles="libsystemd bannedpackages" +mkdir -p "$REPO_ROOT"/log/t +for i in $_logfiles; do + sort "$REPO_ROOT"/log/${i}.txt | uniq > "$REPO_ROOT"/log/t/${i}.txt done +cp -f "$REPO_ROOT"/log/t/*.txt "$REPO_ROOT"/log/ + +rsync "$REPO_ROOT"/log/t/*.txt mirror@pkgmaster.devuan.org:/home/mirror/devuan/ +rsync "$REPO_ROOT"/log/oldpackages.txt "$REPO_ROOT"/log/amprolla.txt \ + mirror@pkgmaster.devuan.org:/home/mirror/devuan/ +}