comparison compose2/preview/setup.sh @ 130:bf5f8acc35f2

DEP-12: improve compse setup.sh
author smith@nwoca.org
date Mon, 08 May 2017 18:25:23 +0100
parents 5c986cbb22b8
children a095257a342b
comparison
equal deleted inserted replaced
129:5c986cbb22b8 130:bf5f8acc35f2
1 #!/bin/bash 1 #!/bin/bash
2 # Sets up a new district project based on SSDT default configuration in the current working directory. 2 # Sets up a new district project based on SSDT default configuration in the current working directory.
3 # 3 #
4 # Usage: 4 # Usage:
5 # 5 #
6 # /data/preview/sampleville $ /ssdt/compose2/preview/setup.sh 6 # /data/preview/sampletown $ /ssdt/compose2/preview/setup.sh
7 # 7 #
8 # Will create a docker-compose.yml and .env file with default settings. 8 # Will create a docker-compose.yml and .env file with default settings.
9 # 9 #
10 # 10 #
11 source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/.functions.sh" 11 source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/.functions.sh"
12 12
13 base=$(dirname "${BASH_SOURCE[0]}") 13 base=$(dirname "${BASH_SOURCE[0]}")
14
15 echo "Preparing '$(basename $PWD)' with default USxS configuration"
14 16
15 if [ ! -e "docker-compose.yml" ] ; then 17 if [ ! -e "docker-compose.yml" ] ; then
16 cp $base/usxs-template.yml ./docker-compose.yml 18 cp $base/usxs-template.yml ./docker-compose.yml
17 echo "created docker-compose.yml" 19 echo "created docker-compose.yml"
18 fi 20 fi
23 25
24 if [ "$COMPOSE_PROJECT_NAME" == "" ] 26 if [ "$COMPOSE_PROJECT_NAME" == "" ]
25 then 27 then
26 echo "COMPOSE_PROJECT_NAME=$(basename $PWD)" >> .env 28 echo "COMPOSE_PROJECT_NAME=$(basename $PWD)" >> .env
27 echo "set project name in .env file" 29 echo "set project name in .env file"
30 source .env
28 fi 31 fi
32
33 echo "project '$COMPOSE_PROJECT_NAME' ready with default values. Review or create a docker-compose.override.yml for custom settings."