Mercurial > public > ssdt-docker
comparison prod/setup.sh @ 337:748b0e2204dc
putting old setup.sh back
author | aldrich@ssdt-ohio.org |
---|---|
date | Mon, 04 May 2020 18:59:40 +0100 |
parents | e36bf4191e25 |
children |
comparison
equal
deleted
inserted
replaced
336:dfae5707657d | 337:748b0e2204dc |
---|---|
5 # | 5 # |
6 # /data/preview/sampletown $ /ssdt/compose2/preview/setup.sh [usas,usps...] | 6 # /data/preview/sampletown $ /ssdt/compose2/preview/setup.sh [usas,usps...] |
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 # Updated December 2019 to generate random admin passwords - CatherineAldrich | 10 # Put back in default on 5/4/2020 |
11 source "$(dirname "${BASH_SOURCE[0]}")/../scripts/.functions.sh" | 11 source "$(dirname "${BASH_SOURCE[0]}")/../scripts/.functions.sh" |
12 | 12 |
13 md5calc() { | 13 md5calc() { |
14 md5sum ${1} ; | 14 md5sum ${1} ; |
15 } | 15 } |
78 | 78 |
79 if [ ! "$usas" == "" ] | 79 if [ ! "$usas" == "" ] |
80 then | 80 then |
81 echo " usasdata:" >> ./docker-compose.yml | 81 echo " usasdata:" >> ./docker-compose.yml |
82 [ "$USAS_DB_PASSWORD" == "" ] && echo "USAS_DB_PASSWORD=$(genDBHash)" >> ./.env | 82 [ "$USAS_DB_PASSWORD" == "" ] && echo "USAS_DB_PASSWORD=$(genDBHash)" >> ./.env |
83 [ "$USAS_ADMIN_PASSWORD" == "" ] && echo "USAS_ADMIN_PASSWORD=$(genDBHash)" >> ./.env | |
84 fi | 83 fi |
85 | 84 |
86 if [ ! "$usps" == "" ] | 85 if [ ! "$usps" == "" ] |
87 then | 86 then |
88 echo " uspsdata:" >> ./docker-compose.yml | 87 echo " uspsdata:" >> ./docker-compose.yml |
89 [ "$USPS_DB_PASSWORD" == "" ] && echo "USPS_DB_PASSWORD=$(genDBHash)" >> ./.env | 88 [ "$USPS_DB_PASSWORD" == "" ] && echo "USPS_DB_PASSWORD=$(genDBHash)" >> ./.env |
90 [ "$USPS_ADMIN_PASSWORD" == "" ] && echo "USPS_ADMIN_PASSWORD=$(genDBHash)" >> ./.env | |
91 fi | 89 fi |
92 | 90 |
93 echo "" >> ./docker-compose.yml | 91 echo "" >> ./docker-compose.yml |
94 | 92 |
95 md5calc ./docker-compose.yml > .docker-compose.md5 | 93 md5calc ./docker-compose.yml > .docker-compose.md5 |
101 | 99 |
102 Error! docker-compose.yml file has been modified or checksum missing. Can not auto-apply update(s). | 100 Error! docker-compose.yml file has been modified or checksum missing. Can not auto-apply update(s). |
103 Move customizations to docker-compose.override.yml then delete the docker-compose.yml | 101 Move customizations to docker-compose.override.yml then delete the docker-compose.yml |
104 " | 102 " |
105 fi | 103 fi |
106 ##Only creates a docker-compose.override.yml if one does not already exist. | 104 |
107 if [ ! -e "docker-compose.override.yml" ] | 105 if [ ! -e "docker-compose.override.yml" ] |
108 then | 106 then |
109 echo 'version: "3.3"' >> docker-compose.override.yml | 107 echo 'version: "3.3"' >> docker-compose.override.yml |
110 echo 'services:' >> docker-compose.override.yml | |
111 ##usas admin components | |
112 if [ ! "$usas" == "" ] | |
113 then | |
114 echo ' usasapp:' >> docker-compose.override.yml | |
115 echo ' environment:' >> docker-compose.override.yml | |
116 echo ' - APPLICATION_ADMIN_PASSWORD=${USAS_ADMIN_PASSWORD}' >> docker-compose.override.yml | |
117 echo ' - APPLICATION_ADMIN_RESET=true' >> docker-compose.override.yml | |
118 | |
119 fi | |
120 ##usps admin components | |
121 if [ ! "$usps" == "" ] | |
122 then | |
123 echo ' uspsapp:' >> docker-compose.override.yml | |
124 echo ' environment:' >> docker-compose.override.yml | |
125 echo ' - APPLICATION_ADMIN_PASSWORD=${USPS_ADMIN_PASSWORD}' >> docker-compose.override.yml | |
126 echo ' - APPLICATION_ADMIN_RESET=true' >> docker-compose.override.yml | |
127 | |
128 fi | |
129 ##end of entire if statments for docker-compose.override.yml | |
130 fi | 108 fi |
131 | 109 |
132 if [ "$USAS_APPLICATIONID" == "" ] | 110 if [ "$USAS_APPLICATIONID" == "" ] |
133 then | 111 then |
134 read -e -p "Generate USAS and USPS integration config? <Y/n> " answer | 112 read -e -p "Generate USAS and USPS integration config? <Y/n> " answer |