-
Notifications
You must be signed in to change notification settings - Fork 0
/
prod_environment.sh
executable file
·71 lines (55 loc) · 2.29 KB
/
prod_environment.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash -eux
if [ "$(uname)" == "Darwin" ]; then
printf "OSX detected. This script does not install docker and other tools. Needed to run properly.\n\n"
fi
if [ -f ".env" ]; then
printf "found .env file. Proceeding with load"
else
printf "moving .env into place from template\n Please configure user settings in here"
cp env.template .env
fi
# source .env
. .env
printf "Prod environment setup complete\n"
printf "Starting Syncurity Services....\n\n"
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
## Import ssl cert to docker volume
#if [ "$MB_JETTY_SSL_Keystore" ]; then
#
# printf "Starting Syncurity Metabase Reporting...\n\n"
# docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
#
# printf "Loading selfsigned certificate from ${SELF_SIGNED_CERT}...\n"
#
# container_id="$(docker ps | grep syncurity/metabase | cut -d' ' -f1)"
# echo "docker cp ${SELF_SIGNED_CERT} ${container_id}:${MB_JETTY_SSL_Keystore}"
# docker cp "${SELF_SIGNED_CERT}" "${container_id}:${MB_JETTY_SSL_Keystore}"
#
#elif [ "$CA_SIGNED_CERT" ]; then
#
# printf "Starting Syncurity Metabase Reporting...\n\n"
# docker-compose -f docker-compose.yml -f docker-compose.prod.yml -f docker-compose.prod.sslcert.yml up -d
#
# printf "Loading CA cert certificate from ${CA_SIGNED_CERT}...\n"
# container_id="$(docker ps | grep syncurity/metabase | cut -d' ' -f1)"
# echo "docker cp ${CA_SIGNED_CERT} ${container_id}:${MB_JETTY_SSL_Keystore}"
# docker cp "${CA_SIGNED_CERT}" "${container_id}:${MB_JETTY_SSL_Keystore}"
#
#else
#
# printf "Starting Syncurity Metabase Reporting....\n\n"
# docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
# printf "\nBrowse to http://localhost:3000 to setup metabase\n\n"
#fi
printf "Use bin/start_syn_services.sh and bin/stop_syn_services.sh to turn server on and off \n"
echo "Removing env vars from memory"
unset -v POSTGRESQL_ADMIN_PASSWORD
#Show container environment
sleep 1 && docker ps
echo "Waiting for Syncurity Service to come up..."
docker logs syncurity_postgresql
# while not docker logs metabase_web | grep
# until [[ $(docker logs syncurity_postgresql | grep "Starting server...") ]]; do
# echo "$(docker logs syncurity_postgresql | grep "Starting server...")"
# done
echo "Complete"