From ba85876d09b89079f88d30af19f44295886d9f58 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Tue, 26 Apr 2016 20:23:03 +0800 Subject: [PATCH] new: [host] update locations of ``compose``'s config files. --- precise/host/hooks/install.d/70-0k.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/precise/host/hooks/install.d/70-0k.sh b/precise/host/hooks/install.d/70-0k.sh index e0fc73a9..1903a6c5 100755 --- a/precise/host/hooks/install.d/70-0k.sh +++ b/precise/host/hooks/install.d/70-0k.sh @@ -159,8 +159,9 @@ else fi deactivate - if ! grep "^. /opt/venv/docker-compose/bin/activate$" /etc/compose.local.conf >/dev/null 2>&1; then - cat <> /etc/compose.local.conf + mkdir -p /etc/compose + if ! grep "^. /opt/venv/docker-compose/bin/activate$" /etc/compose/local.conf >/dev/null 2>&1; then + cat <> /etc/compose/local.conf . /opt/venv/docker-compose/bin/activate EOF fi @@ -172,20 +173,25 @@ if ! [ -d "/opt/apps/0k-compose" ]; then fi [ -e /usr/local/bin/compose ] || ln -sfv /opt/apps/0k-compose/bin/compose /usr/local/bin/ +cat < /etc/default/datastore +DATASTORE=/srv/datastore +SNAPSHOT_BACKUP=/var/backups/snapshot +EOF -cat < /etc/compose.conf +cat < /etc/default/compose ## if not provided, this will be the default service launched. export DEFAULT_SERVICES="" export DEFAULT_PROJECT_NAME=$(hostname | cut -f 2 -d . ) -export DOCKERSTORE=/srv/datastore -export DATASTORE=$DOCKERSTORE/data -export CONFIGSTORE=$DOCKERSTORE/config +export DOCKER_DATASTORE=\$([ -e /etc/default/datastore ] && . /etc/default/datastore && echo \$DATASTORE) +export DATASTORE=\$DOCKER_DATASTORE/data +export CONFIGSTORE=\$DOCKER_DATASTORE/config EOF -mkdir -p /etc/compose -echo "DEFAULT_COMPOSE_FILE=/etc/compose/compose.yml" >> /etc/compose.local.conf +echo "DEFAULT_COMPOSE_FILE=/etc/compose/compose.yml" >> /etc/compose/local.conf + +