redmine: process changelogs every 10 minutes

Wrap the original entrypoint script with a custom one that also runs a
loop in the background, which periodically lets redmine fetch git
repositories. When repositories are fetched, redmine interpretes
"closes" etc. in commit messages to mark issues as resolved.

Closes: OS#5331
Change-Id: I2a65fd6be22ae541a93c08c71cf286e4b5ad370f
changes/28/26428/1
Oliver Smith 1 year ago
parent 305ce55b74
commit 440e62b9aa
  1. 4
      redmine/Dockerfile
  2. 17
      redmine/docker-entrypoint-osmo.sh

@ -17,3 +17,7 @@ RUN cd /usr/local/bundle/gems/ruby-openid-2.9.2 && patch -p1 < /tmp/openid_serv
ADD commitlog-references-oshash.diff /tmp/commitlog-references-oshash.diff
RUN cd /usr/src/redmine && patch -p1 < /tmp/commitlog-references-oshash.diff
ADD docker-entrypoint-osmo.sh /
ENTRYPOINT ["/docker-entrypoint-osmo.sh"]
CMD ["passenger", "start"]

@ -0,0 +1,17 @@
#!/bin/sh
# Periodically fetch git repositories
# https://www.redmine.org/projects/redmine/wiki/RedmineRepositories
# Double fork, so it still runs after the exec below
(while :; do
sleep 10m
echo
echo "=== Fetching git repositories (OS#5331) ==="
su redmine -c 'rails runner "Repository.fetch_changesets" -e production'
echo
done &) &
# Run the original docker-entrypoint.sh script. Exec is important, so "tini"
# inside the original script becomes pid 1 to clean up zombies from redmine.
# https://github.com/docker-library/redmine/
exec /docker-entrypoint.sh "$@"
Loading…
Cancel
Save