annotate 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
rev   line source
129
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
1 #!/bin/bash
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
2 # Sets up a new district project based on SSDT default configuration in the current working directory.
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
3 #
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
4 # Usage:
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
5 #
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
6 # /data/preview/sampleville $ /ssdt/compose2/preview/setup.sh
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
7 #
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
8 # Will create a docker-compose.yml and .env file with default settings.
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
9 #
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
10 #
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
11 source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/.functions.sh"
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
12
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
13 base=$(dirname "${BASH_SOURCE[0]}")
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
14
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
15 if [ ! -e "docker-compose.yml" ] ; then
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
16 cp $base/usxs-template.yml ./docker-compose.yml
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
17 echo "created docker-compose.yml"
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
18 fi
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
19
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
20 touch .env
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
21
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
22 source .env
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
23
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
24 if [ "$COMPOSE_PROJECT_NAME" == "" ]
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
25 then
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
26 echo "COMPOSE_PROJECT_NAME=$(basename $PWD)" >> .env
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
27 echo "set project name in .env file"
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
28 fi