Permalink
Browse files

Added environment variables support for assets precompile

  • Loading branch information...
ajgon committed Apr 27, 2016
1 parent af560db commit f24e742be4ab8ca4917171fb69a3015ae7dbc931
Showing with 7 additions and 2 deletions.
  1. +6 −1 libraries/drivers_framework_rails.rb
  2. +1 −1 spec/unit/recipes/deploy_spec.rb
@@ -16,15 +16,20 @@ def raw_out
def after_deploy(context)
output = out
deploy_to = deploy_dir(app)
env = environment
context.execute 'assets:precompile' do
command output[:assets_precompilation_command]
user node['deployer']['user']
cwd File.join(deploy_to, 'current')
group www_group
environment output[:deploy_environment]
environment env
end if out[:assets_precompile]
end
def environment
app['environment'].merge(out[:deploy_environment])
end
end
end
end
@@ -61,7 +61,7 @@
expect(chef_run).to run_execute('start unicorn')
expect(chef_run).to run_execute('assets:precompile').with(
command: '/usr/local/bin/bundle exec rake assets:precompile',
environment: { 'RAILS_ENV' => 'production' },
environment: { 'ENV_VAR1' => 'test', 'ENV_VAR2' => 'some data', 'RAILS_ENV' => 'production' },
cwd: "/srv/www/#{aws_opsworks_app['shortname']}/current"
)
expect(deploy).to notify('service[nginx]').to(:reload).delayed

0 comments on commit f24e742

Please sign in to comment.