Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .docker/scripts/entrypoint_mautic_cron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,16 @@ crontab -u www-data /opt/mautic/cron/mautic
mkfifo /tmp/stdout
chmod 777 /tmp/stdout

# ensure the PHP env vars are present during cronjobs
declare -p | grep 'PHP_INI_VALUE_' > /tmp/cron.env
# ensure the PHP env vars and database settings are present during cronjobs
# The cron daemon does not reliably inherit the container environment into each job,
# so the jobs need an explicit shell environment.
{
declare -p | grep -E '^(declare -x (PHP_INI_VALUE_|MAUTIC_DB_|MAUTIC_SITE_URL))'
# Written verbatim to /tmp/cron.env and evaluated by the cron job, so the
# variables must NOT be expanded here.
# shellcheck disable=SC2016
printf '%s\n' 'if [ -n "${MAUTIC_DB_NAME:-}" ] && [ -z "${MAUTIC_DB_DATABASE:-}" ]; then export MAUTIC_DB_DATABASE="$MAUTIC_DB_NAME"; fi'
} > /tmp/cron.env

# wait until Mautic is installed
# shellcheck disable=SC2016
Expand Down
Loading