diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-02-07 13:01:10 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-02-07 13:01:10 +0000 |
commit | aadd038d0e84d134f419582cddf6179fdd49c1ad (patch) | |
tree | 2230da1c730c697a979d514a59bf4712dce8c713 /script/rails-post-deploy | |
parent | 3dbdc946530f468a2f2a7e86108f437fc6bcff9f (diff) |
Attempt to ensure tests always run using the "test" environment, by:
1) Not overriding any *existing* RAILS_ENV setting in rails_env.rb
2) Always creating a rails_env.rb file
Diffstat (limited to 'script/rails-post-deploy')
-rwxr-xr-x | script/rails-post-deploy | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/script/rails-post-deploy b/script/rails-post-deploy index 8b9476afe..d9e9bb3f1 100755 --- a/script/rails-post-deploy +++ b/script/rails-post-deploy @@ -58,21 +58,20 @@ cd .. # Force appropriate environment in production if [ "$OPTION_STAGING_SITE" = "0" ] then - if [ ! -e "config/rails_env.rb" ] - then - cat <<-END - - ***************************************************************** - WARNING: About to make config/rails_env.rb which, via special - code in config/boot.rb, forces the Rails environment to be - "production". If this is a development system, please edit your - config/general.yml file and set the STAGING_SITE option to 1, - and also delete the generated config/rails_env.rb file. - ***************************************************************** + cat <<-END - END - fi - echo "ENV['RAILS_ENV'] = 'production'" > config/rails_env.rb + ***************************************************************** + WARNING: About to make config/rails_env.rb which, via special + code in config/boot.rb, forces the Rails environment to be + "production". If this is a development system, please edit your + config/general.yml file and set the STAGING_SITE option to 1, + and also delete the generated config/rails_env.rb file. + Alternatively, you can override config/rails_env.rb at any time + with an environment variable. + ***************************************************************** + + END + echo "ENV['RAILS_ENV'] ||= 'production'" > config/rails_env.rb fi if [ -n "$OPTION_THEME_URL" ] |