FIX Cron task requires extra environment variables
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-03-09 19:46:25 +01:00
parent 20f69cd94c
commit e663e86123
2 changed files with 7 additions and 5 deletions

View File

@@ -16,6 +16,8 @@ RUN apt-get update \
&& rm -f /etc/cron.d/* \
# Install plugin dependencies \
&& bundle check || bundle install \
&& chmod +x /pre-entrypoint.sh
ENTRYPOINT ["/pre-entrypoint.sh"]
&& chmod +x /pre-entrypoint.sh \
# setting ENTRYPOINT destroys CMD so replace the entrypoint script and call it later \
# (see bottom note in https://docs.docker.com/engine/reference/builder/#entrypoint) \
&& mv /docker-entrypoint.sh /orig-entrypoint.sh \
&& mv /pre-entrypoint.sh /docker-entrypoint.sh

View File

@@ -5,13 +5,13 @@ echo "Pre-start $@"
echo "Pre-start $1 $2 $3"
echo "Creating CRON entry for rake redmine:send_reminders"
echo "$REDMINE_SEND_REMINDERS_CRON_EXPR root cd /usr/src/redmine && rake redmine:send_reminders days=$REDMINE_SEND_REMINDERS_DAYS RAILS_ENV=production" > /etc/cron.d/redmine
echo "$REDMINE_SEND_REMINDERS_CRON_EXPR redmine GEM_HOME=/usr/local/bundle BUNDLE_APP_CONFIG=/usr/local/bundle /usr/local/bin/rake -f /usr/src/redmine/Rakefile redmine:send_reminders days=$REDMINE_SEND_REMINDERS_DAYS RAILS_ENV=production" > /etc/cron.d/redmine
chmod 0644 /etc/cron.d/redmine
crontab /etc/cron.d/redmine
echo Starting CRON
service cron start
set -- /docker-entrypoint.sh "$@"
set -- /orig-entrypoint.sh "$@"
echo Executing original Redmine "$@"
exec "$@"