Mercurial > public > ssdt-docker
comparison compose2/preview/setup.sh @ 129:5c986cbb22b8
DEP-12: add simple script to standardize setting up projects
author | smith@nwoca.org |
---|---|
date | Mon, 08 May 2017 16:38:33 +0100 |
parents | |
children | bf5f8acc35f2 |
comparison
equal
deleted
inserted
replaced
128:c39100a00b5c | 129:5c986cbb22b8 |
---|---|
1 #!/bin/bash | |
2 # Sets up a new district project based on SSDT default configuration in the current working directory. | |
3 # | |
4 # Usage: | |
5 # | |
6 # /data/preview/sampleville $ /ssdt/compose2/preview/setup.sh | |
7 # | |
8 # Will create a docker-compose.yml and .env file with default settings. | |
9 # | |
10 # | |
11 source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/.functions.sh" | |
12 | |
13 base=$(dirname "${BASH_SOURCE[0]}") | |
14 | |
15 if [ ! -e "docker-compose.yml" ] ; then | |
16 cp $base/usxs-template.yml ./docker-compose.yml | |
17 echo "created docker-compose.yml" | |
18 fi | |
19 | |
20 touch .env | |
21 | |
22 source .env | |
23 | |
24 if [ "$COMPOSE_PROJECT_NAME" == "" ] | |
25 then | |
26 echo "COMPOSE_PROJECT_NAME=$(basename $PWD)" >> .env | |
27 echo "set project name in .env file" | |
28 fi |