From 2528c09f36a86af8885c50d9abf0cc73a737d63e Mon Sep 17 00:00:00 2001 From: James Athey Date: Mon, 2 Apr 2018 13:01:30 -0400 Subject: [PATCH] If db:migrate happens anyway, and we're not doing db:setup in staging OR production, then the rails.config file has nothing else to do and should go away --- .ebextensions/rails.config | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .ebextensions/rails.config diff --git a/.ebextensions/rails.config b/.ebextensions/rails.config deleted file mode 100644 index 69b9db18..00000000 --- a/.ebextensions/rails.config +++ /dev/null @@ -1,23 +0,0 @@ -files: - "/opt/elasticbeanstalk/hooks/appdeploy/post/01_rails_db_setup.sh": - mode: "000755" - owner: root - group: root - content: | - #!/usr/bin/env bash - - . $(/opt/elasticbeanstalk/bin/get-config container -k support_dir)/envvars - . $(/opt/elasticbeanstalk/bin/get-config container -k script_dir)/use-app-ruby.sh - - cd $(/opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir) - - if [ "$EB_ENVIRONMENT" == "move-mil-prod" ] - then - # In production, ensure that DB migrations run because this might be a new version of the app that requires it, but do not blow the DB away and re-seed - su -s /bin/bash -c 'DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bin/rails db:migrate' $(/opt/elasticbeanstalk/bin/get-config container -k app_user) - else - # In all other environments, for simplicity and ease of development, just blow the DB away and re-seed - su -s /bin/bash -c 'DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bin/rails db:setup' $(/opt/elasticbeanstalk/bin/get-config container -k app_user) - fi - - rm -- "$0"