Mercurial > public > ssdt-docker
changeset 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 | c39100a00b5c |
children | bf5f8acc35f2 |
files | compose2/preview/setup.sh |
diffstat | 1 files changed, 28 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compose2/preview/setup.sh Mon May 08 16:38:33 2017 +0100 @@ -0,0 +1,28 @@ +#!/bin/bash +# Sets up a new district project based on SSDT default configuration in the current working directory. +# +# Usage: +# +# /data/preview/sampleville $ /ssdt/compose2/preview/setup.sh +# +# Will create a docker-compose.yml and .env file with default settings. +# +# +source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/.functions.sh" + +base=$(dirname "${BASH_SOURCE[0]}") + +if [ ! -e "docker-compose.yml" ] ; then + cp $base/usxs-template.yml ./docker-compose.yml + echo "created docker-compose.yml" +fi + +touch .env + +source .env + +if [ "$COMPOSE_PROJECT_NAME" == "" ] +then + echo "COMPOSE_PROJECT_NAME=$(basename $PWD)" >> .env + echo "set project name in .env file" +fi