From 360a0771d9e677fcc4ebc08620bc3cc36d9157e9 Mon Sep 17 00:00:00 2001 From: Tom Wiesing Date: Mon, 12 Oct 2020 08:25:14 +0200 Subject: [PATCH] Add 'cron-all' utility script --- distillery/cron-all.sh | 18 ++++++++++++++++++ distillery/utils/cron.sh | 8 ++++++++ 2 files changed, 26 insertions(+) create mode 100644 distillery/cron-all.sh create mode 100755 distillery/utils/cron.sh diff --git a/distillery/cron-all.sh b/distillery/cron-all.sh new file mode 100644 index 0000000..0454a2a --- /dev/null +++ b/distillery/cron-all.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e + +# read the lib/shared.sh and read the slug argument. +DISABLE_LOG=1 +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +cd "$DIR" +source "$DIR/lib/lib.sh" +unset DISABLE_LOG + +# update all the instances +for slug in $(sql_bookkeep_list); do + read -r INSTANCE_BASE_DIR <<< "$(sql_bookkeep_load "${slug}" "filesystem_base" | tail -n +2)" + log_info "=> Runnning cron for '$slug'" + cd "$INSTANCE_BASE_DIR" + docker-compose exec barrel /bin/bash /utils/cron.sh +done + diff --git a/distillery/utils/cron.sh b/distillery/utils/cron.sh new file mode 100755 index 0000000..4b1c3ad --- /dev/null +++ b/distillery/utils/cron.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# This utility script can be used to run all cron tasks. + +cd /var/www/data/project || exit 1 +export PATH=/var/www/data/project/vendor/bin:$PATH + +drush core-cron \ No newline at end of file