Skip to content
This repository has been archived by the owner on Jul 27, 2018. It is now read-only.

Commit

Permalink
in production, run db:migrate, in all other environments, run db:setup
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesatheyDDS committed Apr 2, 2018
1 parent 4097362 commit 857453e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .ebextensions/rails.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ files:

cd $(/opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir)

if [ "$EB_ENVIRONMENT" != "move-mil-prod" ]
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

Expand Down

0 comments on commit 857453e

Please sign in to comment.