From: Tom Hughes Date: Wed, 5 Aug 2020 21:36:43 +0000 (+0100) Subject: Use a writable home directory when running yarn X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/d1e8786ca687c318e785f30970dae5564cdd2317 Use a writable home directory when running yarn --- diff --git a/cookbooks/web/resources/rails_port.rb b/cookbooks/web/resources/rails_port.rb index 6d39b937b..6395fb1d5 100644 --- a/cookbooks/web/resources/rails_port.rb +++ b/cookbooks/web/resources/rails_port.rb @@ -405,7 +405,8 @@ action :create do execute "#{rails_directory}/package.json" do action :nothing command "bundle#{new_resource.ruby} exec rake yarn:install" - environment "RAILS_ENV" => "production" + environment "HOME" => rails_directory, + "RAILS_ENV" => "production" cwd rails_directory user new_resource.user group new_resource.group @@ -416,7 +417,8 @@ action :create do execute "#{rails_directory}/app/assets/javascripts/i18n" do action :nothing command "bundle#{new_resource.ruby} exec rake i18n:js:export" - environment "RAILS_ENV" => "production" + environment "HOME" => rails_directory, + "RAILS_ENV" => "production" cwd rails_directory user new_resource.user group new_resource.group @@ -427,7 +429,8 @@ action :create do execute "#{rails_directory}/public/assets" do action :nothing command "bundle#{new_resource.ruby} exec rake assets:precompile" - environment "RAILS_ENV" => "production" + environment "HOME" => rails_directory, + "RAILS_ENV" => "production" cwd rails_directory user new_resource.user group new_resource.group