forked from parazyd/amprolla
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathorchestrate.sh
More file actions
executable file
·31 lines (23 loc) · 959 Bytes
/
orchestrate.sh
File metadata and controls
executable file
·31 lines (23 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# See LICENSE file for copyright and license details.
# Orchestration of incremental updates
# Make sure these correlate to lib/config.py
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
while true; do
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"
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"
sleep 3600
done