|
@@ -6,15 +6,31 @@ servers="$(RAILS_ENV=$RAILS_ENV bundle exec rake servers 2>&1)"
|
6
|
6
|
echo $servers
|
7
|
7
|
|
8
|
8
|
if [ "$(echo "$servers" | cut -c0-2)" == "No" ]; then
|
9
|
|
- echo ">>> Add test-install as the default server"
|
|
9
|
+ echo ">>> Adding test-install as the default server"
|
10
|
10
|
bundle exec rake servers:add["https://test-install.blindsidenetworks.com/bigbluebutton/api","8cd8ef52e8e101574e400365b55e11a6"]
|
11
|
11
|
bundle exec rake servers
|
12
|
12
|
bundle exec rake status
|
13
|
|
- echo ">>> Server must be enabled from the console"
|
14
|
|
-else
|
15
|
|
- echo ">>> Do nothing"
|
|
13
|
+ echo ">>> Server added by default must be enabled using the rake command"
|
|
14
|
+fi
|
|
15
|
+
|
|
16
|
+if [ "$RAILS_ENV" = "production" ] && [ "$DB_ADAPTER" = "postgresql" ]; then
|
|
17
|
+ while ! curl http://$DB_HOST:${DB_PORT:-5432}/ 2>&1 | grep '52'
|
|
18
|
+ do
|
|
19
|
+ echo "Waiting for postgres to start up ..."
|
|
20
|
+ sleep 1
|
|
21
|
+ done
|
16
|
22
|
fi
|
17
|
23
|
|
|
24
|
+db_create="$(RAILS_ENV=$RAILS_ENV bundle exec rake db:create 2>&1)"
|
|
25
|
+echo $db_create
|
|
26
|
+
|
|
27
|
+if [[ $db_create == *"already exists"* ]]; then
|
|
28
|
+ echo ">>> Database migration"
|
|
29
|
+ bundle exec rake db:migrate
|
|
30
|
+else
|
|
31
|
+ echo ">>> Database initialization"
|
|
32
|
+ bundle exec rake db:schema:load
|
|
33
|
+fi
|
18
|
34
|
|
19
|
35
|
exec tini -- bundle exec puma -C config/puma.rb "$@"
|
20
|
36
|
#tail -f /dev/null
|