Allow project identifier to start with digit.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
FROM redmine:5-bullseye
|
||||
|
||||
COPY plugins/ plugins/
|
||||
COPY pre-entrypoint.sh /pre-entrypoint.sh
|
||||
COPY plugins/ patches/project_identifier.patch .
|
||||
COPY pre-entrypoint.sh /
|
||||
|
||||
ENV REDMINE_SEND_REMINDERS_DAYS=0 \
|
||||
REDMINE_SEND_REMINDERS_CRON_EXPR="0 7 * * 1-5"
|
||||
@@ -20,4 +20,7 @@ RUN apt-get update \
|
||||
# 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
|
||||
&& mv /pre-entrypoint.sh /docker-entrypoint.sh \
|
||||
# Apply patches \
|
||||
&& git apply project_identifier.patch \
|
||||
&& rm project_identifier.patch
|
||||
|
||||
11
patches/project_identifier.patch
Normal file
11
patches/project_identifier.patch
Normal file
@@ -0,0 +1,11 @@
|
||||
--- "a/public/javascripts/project_identifier.js"
|
||||
+++ "b/public/javascripts/project_identifier.js"
|
||||
@@ -55,7 +55,7 @@ function generateProjectIdentifier(identifier, maxlength) {
|
||||
identifier = identifier.replace(diacriticsMap[i].letters, diacriticsMap[i].base);
|
||||
}
|
||||
identifier = identifier.replace(/[^a-z0-9_]+/gi, '-'); // remaining non-alphanumeric => hyphen
|
||||
- identifier = identifier.replace(/^[-_\d]*|[-_]*$/g, ''); // remove hyphens/underscores and numbers at beginning and hyphens/underscores at end
|
||||
+ identifier = identifier.replace(/^[-_]*|[-_]*$/g, ''); // remove hyphens/underscores and numbers at beginning and hyphens/underscores at end
|
||||
identifier = identifier.toLowerCase(); // to lower
|
||||
identifier = identifier.substr(0, maxlength); // max characters
|
||||
return identifier;
|
||||
@@ -1,15 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeo pipefail
|
||||
|
||||
echo "Pre-start $@"
|
||||
echo "Pre-start $1 $2 $3"
|
||||
|
||||
echo "Creating CRON entry for rake redmine:send_reminders"
|
||||
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 -- /orig-entrypoint.sh "$@"
|
||||
|
||||
Reference in New Issue
Block a user