From 2b77e4521787d1024e8e4c710b277e435a3ecd77 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 29 Aug 2014 17:24:44 +0100 Subject: Allow RAILS_ENV to be set in sysvinit-thin Install script on AWS uses development mode by default --- config/sysvinit-thin.ugly | 3 ++- lib/tasks/config_files.rake | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/sysvinit-thin.ugly b/config/sysvinit-thin.ugly index cc604d994..b333f3738 100755 --- a/config/sysvinit-thin.ugly +++ b/config/sysvinit-thin.ugly @@ -17,6 +17,7 @@ NAME=!!(*= $site *)!! SITE_HOME=!!(*= $vhost_dir *)!!/!!(*= $vcspath *)!! DESC="Alaveteli app server" USER=!!(*= $user *)!! +RAILS_ENV=!!(*= $rails_env *)!! set -e @@ -26,7 +27,7 @@ su -l -c "cd $SITE_HOME && bundle exec thin --version &> /dev/null || exit 0" $U start_daemon() { echo -n "Starting $DESC: " cd "$SITE_HOME" && bundle exec thin \ - --environment=production \ + --environment=$RAILS_ENV \ --user="$USER" \ --group="$USER" \ --address=127.0.0.1 \ diff --git a/lib/tasks/config_files.rake b/lib/tasks/config_files.rake index 5dda64a04..1528d7324 100644 --- a/lib/tasks/config_files.rake +++ b/lib/tasks/config_files.rake @@ -32,7 +32,8 @@ namespace :config_files do :user => ENV['DEPLOY_USER'], :vhost_dir => ENV['VHOST_DIR'], :vcspath => ENV.fetch('VCSPATH') { 'alaveteli' }, - :site => ENV.fetch('SITE') { 'foi' } + :site => ENV.fetch('SITE') { 'foi' }, + :rails_env => ENV.fetch('RAILS_ENV') { 'development' } } # Use the filename for the $daemon_name ugly variable -- cgit v1.2.3