From bd32c7a2dc0b10b0be209f969b2f8b4ad87c55f7 Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Thu, 27 Aug 2015 18:09:20 -0700 Subject: Move scripts for horizon to docker_templates Change-Id: If260f47ea3e4f9917cf20a6e2013cc81bfa5fc83 Partially-Implements: blueprint remove-docker-dir --- docker_templates/horizon/config-external.sh | 26 +++++++++++++++++++++++++- docker_templates/horizon/start.sh | 24 +++++++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) mode change 120000 => 100644 docker_templates/horizon/config-external.sh mode change 120000 => 100755 docker_templates/horizon/start.sh (limited to 'docker_templates') diff --git a/docker_templates/horizon/config-external.sh b/docker_templates/horizon/config-external.sh deleted file mode 120000 index 32f0838d6..000000000 --- a/docker_templates/horizon/config-external.sh +++ /dev/null @@ -1 +0,0 @@ -../../docker/common/horizon/config-external.sh \ No newline at end of file diff --git a/docker_templates/horizon/config-external.sh b/docker_templates/horizon/config-external.sh new file mode 100644 index 000000000..8e9fc47a0 --- /dev/null +++ b/docker_templates/horizon/config-external.sh @@ -0,0 +1,25 @@ +#!/bin/bash +SOURCE="/opt/kolla/horizon/local_settings" +TARGET="/etc/openstack-dashboard/local_settings" +OWNER="horizon" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi + +if [[ "${KOLLA_BASE_DISTRO}" == "ubuntu" || \ + "${KOLLA_BASE_DISTRO}" == "debian" ]]; then + SOURCE="/opt/kolla/horizon/horizon.conf" + TARGET="/etc/apache2/sites-enabled/000-default.conf" +else + SOURCE="/opt/kolla/horizon/horizon.conf" + TARGET="/etc/httpd/sites.d/horizon.conf" +fi + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker_templates/horizon/start.sh b/docker_templates/horizon/start.sh deleted file mode 120000 index 16347cc9b..000000000 --- a/docker_templates/horizon/start.sh +++ /dev/null @@ -1 +0,0 @@ -../../docker/common/horizon/start.sh \ No newline at end of file diff --git a/docker_templates/horizon/start.sh b/docker_templates/horizon/start.sh new file mode 100755 index 000000000..096326a3a --- /dev/null +++ b/docker_templates/horizon/start.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -o errexit + +# Loading common functions +source /opt/kolla/kolla-common.sh + +if [[ "${KOLLA_BASE_DISTRO}" == "ubuntu" || \ + "${KOLLA_BASE_DISTRO}" == "debian" ]]; then + CMD="/usr/sbin/apache2" + ARGS="-DFOREGROUND" + + # Loading Apache2 ENV variables + source /etc/apache2/envvars +else + CMD="/usr/sbin/httpd" + ARGS="-DFOREGROUND" +fi + +# Execute config strategy +set_configs + +exec $CMD $ARGS -- cgit v1.2.3