How to precompile assets with Chef?

后端 未结 4 1903
慢半拍i
慢半拍i 2021-02-02 00:27

OpsWorks isn\'t precompiling assets on deploy. I found this recipe in this thread but I think it\'s not complete though, or missing something because I get an error about

4条回答
  •  抹茶落季
    2021-02-02 01:04

    In AWS Opsworks I use the following recipe:

    execute 'rake assets:precompile' do
      cwd "#{node[:deploy_to]}/current"
      user 'root'
      command 'bundle exec rake assets:precompile'
      environment 'RAILS_ENV' => node[:environment_variables][:RAILS_ENV]
    end
    

    I run this command as root because the instance needs the right permission to write to the release path. Running the command as the deploy user renders a permission denied error.

提交回复
热议问题