From d5aeacbfeca3b9f07ff846dcb6f877ac4e59095f Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 27 Sep 2018 17:16:28 +0100 Subject: [Docker] Support for cobrands This adds a script for loading cobrands into an instance of the FixMyStreet Docker container. A directory containing the necessary module, templates, css, etc should be mapped into the container at `/var/www/fixmystreet/cobrand` and activated by adding the cobrand to `ALLOWED_COBRANDS` as usual. See the documentation at https://fixmystreet.org/install/docker for more details. --- bin/docker-cobrand | 16 ++++++++++++++++ bin/docker.preinit | 7 +++++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100755 bin/docker-cobrand diff --git a/bin/docker-cobrand b/bin/docker-cobrand new file mode 100755 index 000000000..05c02c1ce --- /dev/null +++ b/bin/docker-cobrand @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e +shopt -s nullglob + +LN_FLAGS="-s -f -v" +cobrand="/var/www/fixmystreet/cobrand" +FMS="/var/www/fixmystreet/fixmystreet" + +PATHS=(perllib/FixMyStreet/Cobrand templates/web templates/email web/cobrands conf) + +for path in "${PATHS[@]}"; do + for c in $cobrand/$path/*; do + ln $LN_FLAGS $c $FMS/$path + done +done diff --git a/bin/docker.preinit b/bin/docker.preinit index 12881ef0b..459e89de2 100644 --- a/bin/docker.preinit +++ b/bin/docker.preinit @@ -30,8 +30,11 @@ if ! su $FMS_DB_USER -c "psql -h $FMS_DB_HOST -U $FMS_DB_USER -l | egrep \"^ *${ su $FMS_DB_USER -c "createdb -h $FMS_DB_HOST -U $FMS_DB_USER --owner \"$FMS_DB_USER\" \"$FMS_DB_NAME\"" fi -# Ensure the schema is up-to-date. -su $FMS_DB_USER -c "${FMS_ROOT}/bin/update-schema --commit" +# Slot in cobrand, if one is present +su $FMS_DB_USER -c "${FMS_ROOT}/bin/docker-cobrand" + +# Ensure things are up to date - schema, CSS, etc +su $FMS_DB_USER -c "${FMS_ROOT}/script/update" # Update reports su $FMS_DB_USER -c "${FMS_ROOT}/bin/update-all-reports" -- cgit v1.2.3