From 32870e8128d0d3bd871b63183dc97492930d253b Mon Sep 17 00:00:00 2001 From: Guillaume Lazzara Date: Tue, 7 Jun 2016 10:31:54 +0200 Subject: [PATCH 1/2] Link fog credentials file during deployment --- config/deploy.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/deploy.rb b/config/deploy.rb index 8f377a78a..6e25a2cf6 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -63,6 +63,7 @@ set :shared_paths, [ 'public/system', 'public/uploads', 'config/database.yml', + "config/fog_credentials.yml", 'config/initializers/secret_token.rb', "config/environments/#{ENV['to']}.rb", "config/initializers/token.rb", @@ -132,7 +133,7 @@ task :deploy => :environment do to :launch do queue "/etc/init.d/#{user} upgrade " - + queue "cd #{deploy_to}/#{current_path}/" queue "bundle exec rake db:seed RAILS_ENV=#{rails_env}" queue %[echo "-----> Rake Seeding Completed."] From 0c67cda7c54e5250c43ae59159b92799b946fbfc Mon Sep 17 00:00:00 2001 From: Guillaume Lazzara Date: Tue, 7 Jun 2016 10:32:21 +0200 Subject: [PATCH 2/2] Set specific cache path regarding environment --- app/uploaders/cerfa_uploader.rb | 6 +++++- app/uploaders/piece_justificative_uploader.rb | 6 +++++- app/uploaders/procedure_logo_uploader.rb | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/uploaders/cerfa_uploader.rb b/app/uploaders/cerfa_uploader.rb index 1f8371a38..0b798ec81 100644 --- a/app/uploaders/cerfa_uploader.rb +++ b/app/uploaders/cerfa_uploader.rb @@ -19,7 +19,11 @@ class CerfaUploader < CarrierWave::Uploader::Base end def cache_dir - '/tmp/tps-cache' + if Rails.env.production? + '/tmp/tps-cache' + else + '/tmp/tps-dev-cache' + end end # Add a white list of extensions which are allowed to be uploaded. diff --git a/app/uploaders/piece_justificative_uploader.rb b/app/uploaders/piece_justificative_uploader.rb index c3cd6a556..5f26b3d5f 100644 --- a/app/uploaders/piece_justificative_uploader.rb +++ b/app/uploaders/piece_justificative_uploader.rb @@ -19,7 +19,11 @@ class PieceJustificativeUploader < CarrierWave::Uploader::Base end def cache_dir - '/tmp/tps-cache' + if Rails.env.production? + '/tmp/tps-cache' + else + '/tmp/tps-dev-cache' + end end # Add a white list of extensions which are allowed to be uploaded. diff --git a/app/uploaders/procedure_logo_uploader.rb b/app/uploaders/procedure_logo_uploader.rb index dab2a2f79..fd1366e0d 100644 --- a/app/uploaders/procedure_logo_uploader.rb +++ b/app/uploaders/procedure_logo_uploader.rb @@ -22,7 +22,11 @@ class ProcedureLogoUploader < CarrierWave::Uploader::Base end def cache_dir - '/tmp/tps-cache' + if Rails.env.production? + '/tmp/tps-cache' + else + '/tmp/tps-dev-cache' + end end # Add a white list of extensions which are allowed to be uploaded.