aboutsummaryrefslogtreecommitdiffstats
path: root/mkosibuild-cron
diff options
context:
space:
mode:
authorDennis Eriksen <d@ennis.no>2020-09-06 22:06:23 +0200
committerDennis Eriksen <d@ennis.no>2020-09-06 22:06:23 +0200
commit8860b9b713b2e2dea4cd78d197d610ffd3963992 (patch)
treeb5c29fe5a7ec80ec8428ded70d479d4b173ba9e6 /mkosibuild-cron
parentadd symlink to nspawn-dir, and other small fixes (diff)
downloadmkosibuild-8860b9b713b2e2dea4cd78d197d610ffd3963992.tar.gz
Adding the possibility to decide when to rebuild machines
Add HOURLY/DAILY/WEEKLY/MONTHLY_MACHINES to /etc/mkosibuild to select when to rebuild the machines
Diffstat (limited to 'mkosibuild-cron')
-rwxr-xr-xmkosibuild-cron20
1 files changed, 19 insertions, 1 deletions
diff --git a/mkosibuild-cron b/mkosibuild-cron
index 41179e2..7678e6e 100755
--- a/mkosibuild-cron
+++ b/mkosibuild-cron
@@ -24,7 +24,25 @@ export CRONSUFFIX
MACHINES=()
# Import config to override above config
-[[ -r /etc/mkosibuild ]] && . /etc/mkosibuild
+if [[ -r /etc/mkosibuild ]]; then
+ . /etc/mkosibuild
+ crondir="$(echo "$0" | awk -F'/' '{print $3}')"
+ if [[ "${crondir}" == "cron.hourly" ]] && [[ -n "${HOURLY_MACHINES+x}" ]]; then
+ MACHINES=("${HOURLY_MACHINES[*]}")
+ elif [[ "${crondir}" == "cron.daily" ]] && [[ -n "${DAILY_MACHINES+x}" ]]; then
+ MACHINES=("${DAILY_MACHINES[*]}")
+ elif [[ "${crondir}" == "cron.weekly" ]] && [[ -n "${WEEKLY_MACHINES+x}" ]]; then
+ MACHINES=("${WEEKLY_MACHINES[*]}")
+ elif [[ "${crondir}" == "cron.monthly" ]] && [[ -n "${MONTHLY_MACHINES+x}" ]]; then
+ MACHINES=("${MONTHLY_MACHINES[*]}")
+ fi
+fi
+
+
+for machine in ${MACHINES[*]}; do
+ echo "${machine}"
+done
+exit
# Check if logdir exists, and create it if not
[[ -d "${LOGDIR}" ]] || mkdir "${LOGDIR}"