annotate prod/setup.sh @ 335:9e38403ca597

testing remote
author aldrich
date Fri, 07 Feb 2020 16:22:14 +0000
parents e36bf4191e25
children 748b0e2204dc
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 #
135
03e39b95d904 DEP-12: convert to compose verison 3.1 (again)
smith@nwoca.org
parents: 134
diff changeset
6 # /data/preview/sampletown $ /ssdt/compose2/preview/setup.sh [usas,usps...]
03e39b95d904 DEP-12: convert to compose verison 3.1 (again)
smith@nwoca.org
parents: 134
diff changeset
7 #
129
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 #
333
e36bf4191e25 testing
aldrich
parents: 328
diff changeset
10 # Updated December 2019 to generate random admin passwords - CatherineAldrich
145
75aa7005b544 DEP-12: move comopse files to 'pilot' location
smith@nwoca.org
parents: 136
diff changeset
11 source "$(dirname "${BASH_SOURCE[0]}")/../scripts/.functions.sh"
129
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
12
136
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
13 md5calc() {
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
14 md5sum ${1} ;
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
15 }
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
16
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
17 md5verify() {
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
18 md5sum -c --status ${1} ;
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
19 }
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
20
149
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
21 genDBHash() {
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
22 echo $(date +%s%N | sha256sum | base64 | head -c 32 ; echo)
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
23 }
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
24
129
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
25 base=$(dirname "${BASH_SOURCE[0]}")
132
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
26 default_name=$(basename $PWD)
129
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
27
135
03e39b95d904 DEP-12: convert to compose verison 3.1 (again)
smith@nwoca.org
parents: 134
diff changeset
28 args="$1$2"
03e39b95d904 DEP-12: convert to compose verison 3.1 (again)
smith@nwoca.org
parents: 134
diff changeset
29
136
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
30 usas=""
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
31 usps=""
135
03e39b95d904 DEP-12: convert to compose verison 3.1 (again)
smith@nwoca.org
parents: 134
diff changeset
32
03e39b95d904 DEP-12: convert to compose verison 3.1 (again)
smith@nwoca.org
parents: 134
diff changeset
33 if [ "$args" == "" ] || [ -z "${args##*usas*}" ]
03e39b95d904 DEP-12: convert to compose verison 3.1 (again)
smith@nwoca.org
parents: 134
diff changeset
34 then
03e39b95d904 DEP-12: convert to compose verison 3.1 (again)
smith@nwoca.org
parents: 134
diff changeset
35 usas=1
03e39b95d904 DEP-12: convert to compose verison 3.1 (again)
smith@nwoca.org
parents: 134
diff changeset
36 fi
03e39b95d904 DEP-12: convert to compose verison 3.1 (again)
smith@nwoca.org
parents: 134
diff changeset
37
03e39b95d904 DEP-12: convert to compose verison 3.1 (again)
smith@nwoca.org
parents: 134
diff changeset
38 if [ "$args" == "" ] || [ -z "${args##*usps*}" ]
03e39b95d904 DEP-12: convert to compose verison 3.1 (again)
smith@nwoca.org
parents: 134
diff changeset
39 then
03e39b95d904 DEP-12: convert to compose verison 3.1 (again)
smith@nwoca.org
parents: 134
diff changeset
40 usps=1
03e39b95d904 DEP-12: convert to compose verison 3.1 (again)
smith@nwoca.org
parents: 134
diff changeset
41 fi
03e39b95d904 DEP-12: convert to compose verison 3.1 (again)
smith@nwoca.org
parents: 134
diff changeset
42
130
bf5f8acc35f2 DEP-12: improve compse setup.sh
smith@nwoca.org
parents: 129
diff changeset
43 echo "Preparing '$(basename $PWD)' with default USxS configuration"
bf5f8acc35f2 DEP-12: improve compse setup.sh
smith@nwoca.org
parents: 129
diff changeset
44
129
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
45 touch .env
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
46 source .env
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
47
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
48 if [ "$COMPOSE_PROJECT_NAME" == "" ]
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
49 then
132
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
50 read -e -p "Enter project name: <${default_name}> " answer
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
51 project_name=${answer:-$default_name}
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
52 echo "COMPOSE_PROJECT_NAME=${project_name}" >> .env
129
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
53 echo "set project name in .env file"
130
bf5f8acc35f2 DEP-12: improve compse setup.sh
smith@nwoca.org
parents: 129
diff changeset
54 source .env
129
5c986cbb22b8 DEP-12: add simple script to standardize setting up projects
smith@nwoca.org
parents:
diff changeset
55 fi
130
bf5f8acc35f2 DEP-12: improve compse setup.sh
smith@nwoca.org
parents: 129
diff changeset
56
136
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
57 if [ ! -e "docker-compose.yml" ]
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
58 then
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
59 create="OK"
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
60 elif [ -e ".docker-compose.md5" ]; then
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
61 md5verify ./.docker-compose.md5 && create="OK"
132
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
62 fi
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
63
136
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
64 if [ "$create" == "OK" ]
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
65 then
149
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
66 echo "# **** DO NOT MODIFY THIS FILE. ****" > ./docker-compose.yml
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
67 echo "# Place customizations in docker-compose.override.yml and .env" >> ./docker-compose.yml
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
68 echo "version: \"3.3\"" >> ./docker-compose.yml
136
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
69 echo "services:" >> ./docker-compose.yml
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
70
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
71 [ ! "$usas" == "" ] && cat $base/usas-services.yml >> ./docker-compose.yml
173
10c139726e68 USPSR-2856: ensure blank line after service definitions
smith@nwoca.org
parents: 172
diff changeset
72 echo "" >> ./docker-compose.yml
136
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
73
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
74 [ ! "$usps" == "" ] && cat $base/usps-services.yml >> ./docker-compose.yml
173
10c139726e68 USPSR-2856: ensure blank line after service definitions
smith@nwoca.org
parents: 172
diff changeset
75 echo "" >> ./docker-compose.yml
136
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
76
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
77 echo "volumes:" >> ./docker-compose.yml
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
78
149
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
79 if [ ! "$usas" == "" ]
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
80 then
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
81 echo " usasdata:" >> ./docker-compose.yml
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
82 [ "$USAS_DB_PASSWORD" == "" ] && echo "USAS_DB_PASSWORD=$(genDBHash)" >> ./.env
328
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
83 [ "$USAS_ADMIN_PASSWORD" == "" ] && echo "USAS_ADMIN_PASSWORD=$(genDBHash)" >> ./.env
149
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
84 fi
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
85
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
86 if [ ! "$usps" == "" ]
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
87 then
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
88 echo " uspsdata:" >> ./docker-compose.yml
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
89 [ "$USPS_DB_PASSWORD" == "" ] && echo "USPS_DB_PASSWORD=$(genDBHash)" >> ./.env
328
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
90 [ "$USPS_ADMIN_PASSWORD" == "" ] && echo "USPS_ADMIN_PASSWORD=$(genDBHash)" >> ./.env
149
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
91 fi
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
92
136
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
93 echo "" >> ./docker-compose.yml
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
94
149
ab4effbe8d43 DEP-12: generate unique DB passwords for application databases
smith@nwoca.org
parents: 148
diff changeset
95 md5calc ./docker-compose.yml > .docker-compose.md5
136
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
96
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
97 echo "created docker-compose.yml"
166
29c7c4c4e891 if missing, create override file with correct version
smith@nwoca.org
parents: 149
diff changeset
98
136
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
99 else
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
100 echo "
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
101
148
d20c6ff9a821 DEP-12: upgrade to compose format 3.3
smith@nwoca.org
parents: 145
diff changeset
102 Error! docker-compose.yml file has been modified or checksum missing. Can not auto-apply update(s).
136
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
103 Move customizations to docker-compose.override.yml then delete the docker-compose.yml
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
104 "
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
105 fi
328
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
106 ##Only creates a docker-compose.override.yml if one does not already exist.
166
29c7c4c4e891 if missing, create override file with correct version
smith@nwoca.org
parents: 149
diff changeset
107 if [ ! -e "docker-compose.override.yml" ]
29c7c4c4e891 if missing, create override file with correct version
smith@nwoca.org
parents: 149
diff changeset
108 then
328
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
109 echo 'version: "3.3"' >> docker-compose.override.yml
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
110 echo 'services:' >> docker-compose.override.yml
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
111 ##usas admin components
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
112 if [ ! "$usas" == "" ]
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
113 then
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
114 echo ' usasapp:' >> docker-compose.override.yml
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
115 echo ' environment:' >> docker-compose.override.yml
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
116 echo ' - APPLICATION_ADMIN_PASSWORD=${USAS_ADMIN_PASSWORD}' >> docker-compose.override.yml
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
117 echo ' - APPLICATION_ADMIN_RESET=true' >> docker-compose.override.yml
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
118
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
119 fi
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
120 ##usps admin components
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
121 if [ ! "$usps" == "" ]
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
122 then
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
123 echo ' uspsapp:' >> docker-compose.override.yml
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
124 echo ' environment:' >> docker-compose.override.yml
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
125 echo ' - APPLICATION_ADMIN_PASSWORD=${USPS_ADMIN_PASSWORD}' >> docker-compose.override.yml
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
126 echo ' - APPLICATION_ADMIN_RESET=true' >> docker-compose.override.yml
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
127
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
128 fi
1f0ff7540734 USASR-4075 Forcing Unique Admin Password
aldrich@ssdt-ohio.org
parents: 234
diff changeset
129 ##end of entire if statments for docker-compose.override.yml
166
29c7c4c4e891 if missing, create override file with correct version
smith@nwoca.org
parents: 149
diff changeset
130 fi
29c7c4c4e891 if missing, create override file with correct version
smith@nwoca.org
parents: 149
diff changeset
131
134
48c5b742016c DEP-12: correct guard expression on integration keys
smith@nwoca.org
parents: 132
diff changeset
132 if [ "$USAS_APPLICATIONID" == "" ]
132
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
133 then
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
134 read -e -p "Generate USAS and USPS integration config? <Y/n> " answer
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
135 case $answer in
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
136 y | Y | yes | YES ) answer="y";;
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
137 n | N | no | NO ) answer="n";;
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
138 *) answer="y"
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
139 esac
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
140 if [ "$answer" == "y" ]
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
141 then
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
142 usas_id=${COMPOSE_PROJECT_NAME}-usas
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
143 usas_key=$(openssl rand -hex 32)
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
144 usps_id=${COMPOSE_PROJECT_NAME}-usps
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
145 usps_key=$(openssl rand -hex 32)
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
146 echo "USAS_APPLICATIONID=${usas_id}" >> .env
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
147 echo "USAS_APIKEY=$usas_key" >> .env
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
148 echo "USPS_APPLICATIONID=${usps_id}" >> .env
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
149 echo "USPS_APIKEY=$usps_key" >> .env
136
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
150 echo "Created integration API keys. Enable integration modules after applications start"
132
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
151 fi
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
152 fi
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
153
172
65ad866531d3 USPSR-2856: create alias for apps in default network to allow integraation to use default network (instead of proxy, or other network)
smith@nwoca.org
parents: 166
diff changeset
154 if [ "$USAS_APP_HOST" == "" ]
65ad866531d3 USPSR-2856: create alias for apps in default network to allow integraation to use default network (instead of proxy, or other network)
smith@nwoca.org
parents: 166
diff changeset
155 then
65ad866531d3 USPSR-2856: create alias for apps in default network to allow integraation to use default network (instead of proxy, or other network)
smith@nwoca.org
parents: 166
diff changeset
156 echo "USAS_APP_HOST=usasapp-svr" >> .env
65ad866531d3 USPSR-2856: create alias for apps in default network to allow integraation to use default network (instead of proxy, or other network)
smith@nwoca.org
parents: 166
diff changeset
157 fi
65ad866531d3 USPSR-2856: create alias for apps in default network to allow integraation to use default network (instead of proxy, or other network)
smith@nwoca.org
parents: 166
diff changeset
158
65ad866531d3 USPSR-2856: create alias for apps in default network to allow integraation to use default network (instead of proxy, or other network)
smith@nwoca.org
parents: 166
diff changeset
159 if [ "$USPS_APP_HOST" == "" ]
65ad866531d3 USPSR-2856: create alias for apps in default network to allow integraation to use default network (instead of proxy, or other network)
smith@nwoca.org
parents: 166
diff changeset
160 then
65ad866531d3 USPSR-2856: create alias for apps in default network to allow integraation to use default network (instead of proxy, or other network)
smith@nwoca.org
parents: 166
diff changeset
161 echo "USPS_APP_HOST=uspsapp-svr" >> .env
65ad866531d3 USPSR-2856: create alias for apps in default network to allow integraation to use default network (instead of proxy, or other network)
smith@nwoca.org
parents: 166
diff changeset
162 fi
65ad866531d3 USPSR-2856: create alias for apps in default network to allow integraation to use default network (instead of proxy, or other network)
smith@nwoca.org
parents: 166
diff changeset
163
136
72f15ffc9ad2 DEP-12: convert compose files to 3.1. remove template. update bash script to create composite docker-files without extends. prevent overwriting manual changes to docker-comose.yml
smith@nwoca.org
parents: 135
diff changeset
164 echo "Review or create a docker-compose.override.yml for custom settings."
132
a095257a342b DEP-12: add auto-config of initial integration keys
smith@nwoca.org
parents: 130
diff changeset
165