Add 'cron-all' utility script

This commit is contained in:
Tom Wiesing 2020-10-12 08:25:14 +02:00
parent 77a9842db7
commit 360a0771d9
No known key found for this signature in database
GPG key ID: DC1F29F2BC78AB15
2 changed files with 26 additions and 0 deletions

18
distillery/cron-all.sh Normal file
View file

@ -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

8
distillery/utils/cron.sh Executable file
View file

@ -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