Mercurial > public > ssdt-docker
comparison compose/rc/import.yml @ 85:8f45c43ea7a4 feature/djs-DEP-12-docker
DEP-12: start upgrading scripts and compose files for RC and docker 1.12
author | Dave Smith <smith@nwoca.org> |
---|---|
date | Wed, 21 Sep 2016 19:00:41 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
84:36d4c33e43a3 | 85:8f45c43ea7a4 |
---|---|
1 uspsimport: | |
2 image: docker.ssdt.io/usps-import:preview | |
3 command: -i ${IMP_IRN} -u ${IMP_URL} -r ${IMP_PATH} ${IMP_ANON} ${IMP_EM} | |
4 links: | |
5 - uspsdb:database | |
6 environment: | |
7 - DB_HOST=database | |
8 - DB_NAME=$${DATABASE_ENV_DB_NAME} | |
9 - DB_USER=$${DATABASE_ENV_DB_USER} | |
10 - DB_PASS=$${DATABASE_ENV_DB_PASS} | |
11 usasimport: | |
12 image: docker.ssdt.io/usas-import:preview | |
13 command: -i ${IMP_IRN} -u ${IMP_URL} -r ${IMP_PATH} ${IMP_ANON} ${IMP_EM} | |
14 links: | |
15 - usasdb:database | |
16 environment: | |
17 - DB_HOST=database | |
18 - DB_NAME=$${DATABASE_ENV_DB_NAME} | |
19 - DB_USER=$${DATABASE_ENV_DB_USER} | |
20 - DB_PASS=$${DATABASE_ENV_DB_PASS} | |
21 diff -r 5fae3adac2af compose/rc/usas.template.yml | |
22 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
23 +++ b/compose/rc/usas.template.yml Wed Sep 21 21:04:33 2016 +0000 | |
24 @@ -0,0 +1,12 @@ | |
25 +version: "2" | |
26 +services: | |
27 + usasdb: | |
28 + extends: | |
29 + file: /ssdt/compose/preview/usas.yml | |
30 + service: usasdb | |
31 + volumes: | |
32 + - |volumeName|:/var/lib/postgresql/data | |
33 + usasapp: | |
34 + extends: | |
35 + file: /ssdt/compose/preview/usas.yml | |
36 + service: usasapp | |
37 diff -r 5fae3adac2af compose/rc/usas.yml | |
38 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
39 +++ b/compose/rc/usas.yml Wed Sep 21 21:04:33 2016 +0000 | |
40 @@ -0,0 +1,25 @@ | |
41 +# base compose file for USAS Release Candidate release | |
42 +version: "2" | |
43 +services: | |
44 + usasdb: | |
45 + restart: unless-stopped | |
46 + image: docker.ssdt.io/ssdt-postgres:3 | |
47 + volumes: | |
48 + - ${PWD}/backup:/backup | |
49 + environment: | |
50 + - DB_NAME=usasdb | |
51 + - DB_USER=usas | |
52 + - DB_PASS=usasdefault | |
53 + usasapp: | |
54 + restart: unless-stopped | |
55 + image: docker.ssdt.io/usas-app:preview | |
56 + volumes: | |
57 + - ${PWD}/config:/config | |
58 + environment: | |
59 + - DB_HOST=usasdb | |
60 + - DB_NAME=usasdb | |
61 + - DB_USER=usas | |
62 + - DB_PASS=usasdefault | |
63 + - ORG_SSDT_OHIO_USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_SERVERHOST=uspsapp | |
64 + - ORG_SSDT_OHIO_USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_SERVERDNSLOOKUP=true | |
65 + | |
66 diff -r 5fae3adac2af compose/rc/usps.template.yml | |
67 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
68 +++ b/compose/rc/usps.template.yml Wed Sep 21 21:04:33 2016 +0000 | |
69 @@ -0,0 +1,12 @@ | |
70 +uspsdb: | |
71 + extends: | |
72 + file: /ssdt/compose/preview/usps.yml | |
73 + service: uspsdb | |
74 + volumes: | |
75 + - |volumeName|:/var/lib/postgresql/data | |
76 +uspsapp: | |
77 + extends: | |
78 + file: /ssdt/compose/preview/usps.yml | |
79 + service: uspsapp | |
80 + links: | |
81 + - uspsdb:database | |
82 diff -r 5fae3adac2af compose/rc/usps.yml | |
83 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
84 +++ b/compose/rc/usps.yml Wed Sep 21 21:04:33 2016 +0000 | |
85 @@ -0,0 +1,24 @@ | |
86 +# base compose file for usps Release Candidate release | |
87 +version: "2" | |
88 +services: | |
89 + uspsdb: | |
90 + restart: unless-stopped | |
91 + image: docker.ssdt.io/ssdt-postgres:3 | |
92 + volumes: | |
93 + - ${PWD}/backup:/backup | |
94 + environment: | |
95 + - DB_NAME=uspsdb | |
96 + - DB_USER=usps | |
97 + - DB_PASS=uspsdefault | |
98 + uspsapp: | |
99 + restart: unless-stopped | |
100 + image: docker.ssdt.io/usps-app:preview | |
101 + volumes: | |
102 + - ${PWD}/config:/config | |
103 + environment: | |
104 + - DB_HOST=uspsdb | |
105 + - DB_NAME=uspsdb | |
106 + - DB_USER=usps | |
107 + - DB_PASS=uspsdefault | |
108 + - ORG_SSDT_OHIO_USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_SERVERHOST=usasapp | |
109 + - ORG_SSDT_OHIO_USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_SERVERDNSLOOKUP=true | |
110 diff -r 5fae3adac2af init.sh | |
111 --- a/init.sh Tue Aug 30 16:37:52 2016 +0100 | |
112 +++ b/init.sh Wed Sep 21 21:04:33 2016 +0000 | |
113 @@ -1,3 +1,5 @@ | |
114 #!/bin/bash | |
115 -alias utils='docker run -it -v ${PWD}:/tmp -v /ssdt:/ssdt --rm docker.ssdt.io/ssdt-utils' | |
116 -alias send2ssdt='/ssdt/scripts/send.sh' | |
117 \ No newline at end of file | |
118 +source "$( dirname "${BASH_SOURCE[0]}")/scripts/.functions.sh" | |
119 +alias utils='docker run -it -v ${PWD}:/tmp -v $SSDT_HOME:/ssdt --rm docker.ssdt.io/ssdt-utils' | |
120 +alias send2ssdt='/ssdt/scripts/send.sh' | |
121 +export PATH=$PATH:$SSDT_HOME/scripts | |
122 diff -r 5fae3adac2af scripts/.functions.sh | |
123 --- a/scripts/.functions.sh Tue Aug 30 16:37:52 2016 +0100 | |
124 +++ b/scripts/.functions.sh Wed Sep 21 21:04:33 2016 +0000 | |
125 @@ -1,5 +1,8 @@ | |
126 #!/bin/bash | |
127 | |
128 +export SSDT_SCRIPTS=$(dirname "${BASH_SOURCE[0]}") | |
129 +export SSDT_HOME=$(dirname $SSDT_SCRIPTS) | |
130 + | |
131 # deletes psql data from specified service | |
132 resetDbVolume() { | |
133 # Works for named and unnamed volumes and custom $PGDATA. | |
134 @@ -26,4 +29,11 @@ | |
135 container=$(composeGetContainer $service) | |
136 | |
137 echo "$2" | docker exec -i $container sh -c "gosu postgres psql \$DB_NAME" | |
138 -} | |
139 \ No newline at end of file | |
140 +} | |
141 + | |
142 +composeGetProject() { | |
143 + service=${1?"Must supply service from current project"} | |
144 + container=$(composeGetContainer $service) | |
145 + echo $(docker inspect -f '{{index .Config.Labels "com.docker.compose.project" }}' $container) | |
146 + | |
147 +} | |
148 diff -r 5fae3adac2af scripts/capture.sh | |
149 --- a/scripts/capture.sh Tue Aug 30 16:37:52 2016 +0100 | |
150 +++ b/scripts/capture.sh Wed Sep 21 21:04:33 2016 +0000 | |
151 @@ -1,3 +1,3 @@ | |
152 #!/bin/bash | |
153 # writes tail of current logs to standard out from running containers in compose project. | |
154 -docker-compose ps -q | xargs -I ID docker inspect --format='{{.LogPath}}' ID | xargs tail -n${1-8000} | |
155 +docker-compose logs --no-color $1 | |
156 diff -r 5fae3adac2af scripts/console.sh | |
157 --- a/scripts/console.sh Tue Aug 30 16:37:52 2016 +0100 | |
158 +++ b/scripts/console.sh Wed Sep 21 21:04:33 2016 +0000 | |
159 @@ -1,11 +1,22 @@ | |
160 #!/bin/bash | |
161 +# connects to the telnet console of the application for the specified service of the current project | |
162 | |
163 -# connects to the telnet console of the application for the specified service of the current project | |
164 source "$( dirname "${BASH_SOURCE[0]}")/.functions.sh" | |
165 | |
166 container=$(composeGetContainer ${1?"Must specify the app service of the console to connect to"} ) | |
167 | |
168 ip=$(docker inspect -f '{{.NetworkSettings.IPAddress}}' $container) | |
169 | |
170 -docker run -it -v ${PWD}:/tmp -v /ssdt:/ssdt --rm docker.ssdt.io/ssdt-utils telnet $ip 2000 | tee console.log | |
171 | |
172 +if [ "$ip" == "" ] | |
173 +then | |
174 + ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $container) | |
175 + project=$(composeGetProject ${1} ) | |
176 +fi | |
177 + | |
178 +if [ "$project" == "" ] | |
179 +then | |
180 + docker run -it -v ${PWD}:/tmp -v ${SSDT_HOME}:/ssdt --rm docker.ssdt.io/ssdt-utils telnet $ip 2000 | tee console.log | |
181 +else | |
182 + docker run -it --network ${project}_default --rm docker.ssdt.io/ssdt-utils telnet $ip 2000 | tee console.log | |
183 +fi | |
184 diff -r 5fae3adac2af scripts/info.sh | |
185 --- a/scripts/info.sh Tue Aug 30 16:37:52 2016 +0100 | |
186 +++ b/scripts/info.sh Wed Sep 21 21:04:33 2016 +0000 | |
187 @@ -1,13 +1,14 @@ | |
188 #!/bin/bash | |
189 +source "$( dirname "${BASH_SOURCE[0]}")/.functions.sh" | |
190 echo $BASH_VERSION | |
191 docker version | |
192 docker-compose version | |
193 echo "------- Docker info-------------" | |
194 docker info | |
195 echo "------- Images -----------------" | |
196 -/ssdt/scripts/d-images.sh | |
197 +. $SSDT_HOME/scripts/d-images.sh | |
198 echo "------- Containers------" | |
199 -/ssdt/scripts/d-ps.sh | |
200 +. $SSDT_HOME/scripts/d-ps.sh | |
201 echo "------- OS Processes------------" | |
202 top -b -n 1 | |
203 | |
204 diff -r 5fae3adac2af scripts/send.sh | |
205 --- a/scripts/send.sh Tue Aug 30 16:37:52 2016 +0100 | |
206 +++ b/scripts/send.sh Wed Sep 21 21:04:33 2016 +0000 | |
207 @@ -1,10 +1,12 @@ | |
208 #!/bin/bash | |
209 +source "$( dirname "${BASH_SOURCE[0]}")/.functions.sh" | |
210 file=${1?"Usage: $0 filename [name]\n specify the filename relative to the current directory or - for stdin.\noptionally specify a short name (default to base directory)"} | |
211 + | |
212 if [ "$file" != "-" ] | |
213 then | |
214 file="/tmp/${file}" | |
215 fi | |
216 name=${2:-$(basename $PWD)} | |
217 source=$(hostname) | |
218 -docker run -i -v /ssdt:/ssdt -v ${PWD}:/tmp --rm docker.ssdt.io/ssdt-utils \ | |
219 - curl -F source=$source -F name=$name -F file=@$file https://upload.ssdt.io/upload | |
220 \ No newline at end of file | |
221 +docker run -i -v $SSDT_HOME:/ssdt -v ${PWD}:/tmp --rm docker.ssdt.io/ssdt-utils \ | |
222 + curl -F source=$source -F name=$name -F file=@$file https://upload.ssdt.io/upload |