diff --git a/CHANGELOG.MD b/CHANGELOG.MD index cc025ed..2dbe94d 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -7,9 +7,12 @@ All notable changes to this project will be documented in this file. - #104: setup.sh is now checking for a running docker daemon and exists if not found - #101: adding _netdev to fstab to prevent loss of storage mount on reboots - #103: fixing the SNS topic encryption to allow SES notification sendout +- #99: improved the command within the greenlight task. basically extended the default /bin/start instead of the old quick and dirty hack. ### Changed - renamed the root stack yaml file +- scalelite version push to 1.3 +- Aurora Default Engine version pushed to 10.14 ## [3.0.3] - 2021-05-27 ### Fixed diff --git a/bbb-on-aws-param.json b/bbb-on-aws-param.json index 2092f74..1b98109 100755 --- a/bbb-on-aws-param.json +++ b/bbb-on-aws-param.json @@ -27,7 +27,7 @@ "BBBTurnMinInstances": 1, "BBBTurnDesiredInstances": 1, "BBBDBName": "frontendapp", - "BBBDBEngineVersion": "10.12", + "BBBDBEngineVersion": "10.14", "BBBEnvironmentStage": "dev", "BBBEnvironmentName": "bbbonaws", "BBBEnvironmentType": "scalable", diff --git a/templates/bbb-on-aws-frontendapps.template.yaml b/templates/bbb-on-aws-frontendapps.template.yaml index 6eda923..3d48c63 100644 --- a/templates/bbb-on-aws-frontendapps.template.yaml +++ b/templates/bbb-on-aws-frontendapps.template.yaml @@ -600,7 +600,30 @@ Resources: Command: - /bin/sh - -c - - /usr/local/bin/bundle exec rake db:migrate; /usr/local/bin/bundle exec rake user:create["bbbadmin","${ADMIN_LOGIN}","${ADMIN_PASSWORD}","admin"]; bin/start + - | + if [ "$RAILS_ENV" = "production" ] && [ "$DB_ADAPTER" = "postgresql" ]; then + while ! curl http://$DB_HOST:${DB_PORT:-5432}/ 2>&1 | grep '52' + do + echo "Waiting for postgres to start up ..." + sleep 1 + done + fi + + db_create="$(RAILS_ENV=$RAILS_ENV bundle exec rake db:create 2>&1)" + echo $db_create + + if [[ $db_create == *"already exists"* ]]; then + echo ">>> Database migration" + bundle exec rake db:migrate + else + echo ">>> Database initialization" + bundle exec rake db:schema:load + bundle exec rake user:create["bbbadmin","${ADMIN_LOGIN}","${ADMIN_PASSWORD}","admin"] + fi + + bundle exec rake assets:precompile + + exec bundle exec puma -C config/puma.rb Secrets: - Name: ADMIN_PASSWORD ValueFrom: !Sub "${BBBAdministratorlogin}:password::"