|
| 1 | +#!/bin/sh |
| 2 | + |
| 3 | +VERSION="ams/2.6" |
| 4 | +PATH_TO_CONF="etc/httpd" |
| 5 | + |
| 6 | +if [ ! -d $(pwd)/$VERSION/$PATH_TO_CONF/conf ]; then |
| 7 | + echo "**** ERROR ****" |
| 8 | + echo "This script is supposed to be run in the root directory of the dispatcher project, " |
| 9 | + echo "though we could not find a directory ./$VERSION/$PATH_TO_CONF/conf conf from the current directory." |
| 10 | + echo "Please change to the projects main directory and try again." |
| 11 | + echo "" |
| 12 | + exit 1 |
| 13 | +fi |
| 14 | + |
| 15 | +echo "" |
| 16 | +echo "Starting dispatcher, mounting local configuration from ./$VERSION/$PATH_TO_CONF ..." |
| 17 | +echo " Open your browser at http://publish.docker.local/content/we-retail/us/en.html " |
| 18 | +echo " **** Press Ctrl-C to stop **** " |
| 19 | +echo "" |
| 20 | + |
| 21 | +# copy sample we-retail files |
| 22 | +cp sample/weretail.vhost $VERSION/etc/httpd/conf.d/available_vhosts |
| 23 | +cp sample/weretail_publish_farm.any $VERSION/etc/httpd/conf.dispatcher.d/available_farms/100_weretail_publish_farm.any |
| 24 | +cp sample/weretail_filters.any $VERSION/etc/httpd/conf.dispatcher.d/filters |
| 25 | + |
| 26 | +# create and link up default enabled vhosts |
| 27 | +if [ ! -d $VERSION/etc/httpd/conf.d/enabled_vhosts ]; then |
| 28 | + mkdir $VERSION/etc/httpd/conf.d/enabled_vhosts |
| 29 | +fi |
| 30 | + |
| 31 | +ln -Fs ../available_vhosts/aem_author.vhost $VERSION/etc/httpd/conf.d/enabled_vhosts/aem_author.vhost |
| 32 | +ln -Fs ../available_vhosts/aem_flush_author.vhost $VERSION/etc/httpd/conf.d/enabled_vhosts/aem_flush_author.vhost |
| 33 | +ln -Fs ../available_vhosts/aem_publish.vhost $VERSION/etc/httpd/conf.d/enabled_vhosts/aem_publish.vhost |
| 34 | +ln -Fs ../available_vhosts/aem_flush.vhost $VERSION/etc/httpd/conf.d/enabled_vhosts/aem_flush.vhost |
| 35 | +ln -Fs ../available_vhosts/aem_health.vhost $VERSION/etc/httpd/conf.d/enabled_vhosts/aem_health.vhost |
| 36 | +ln -Fs ../available_vhosts/weretail.vhost $VERSION/etc/httpd/conf.d/enabled_vhosts/weretail.vhost |
| 37 | + |
| 38 | +# create and link up default enabled farms |
| 39 | +if [ ! -d $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms ]; then |
| 40 | + mkdir $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms |
| 41 | +fi |
| 42 | +ln -Fs ../available_farms/000_ams_catchall_farm.any $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms/000_ams_catchall_farm.any |
| 43 | +ln -Fs ../available_farms/001_ams_author_flush_farm.any $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms/001_ams_author_flush_farm.any |
| 44 | +ln -Fs ../available_farms/001_ams_publish_flush_farm.any $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms/001_ams_publish_flush_farm.any |
| 45 | +ln -Fs ../available_farms/002_ams_author_farm.any $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms/002_ams_author_farm.any |
| 46 | +ln -Fs ../available_farms/002_ams_publish_farm.any $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms/002_ams_publish_farm.any |
| 47 | + |
| 48 | +# set up sample configs |
| 49 | +ln -Fs ../available_farms/100_weretail_publish_farm.any $VERSION/etc/httpd/conf.dispatcher.d/enabled_farms/100_weretail_publish_farm.any |
| 50 | + |
| 51 | +# start dispatcher with docker-compose |
| 52 | +docker-compose up -d |
| 53 | + |
0 commit comments