Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
Creates a directory for bundle
Browse files Browse the repository at this point in the history
Creates the `vendor/bundle` director under `shared` we can cache ruby gems.
  • Loading branch information
beirigo committed Aug 30, 2016
1 parent f00e44b commit 7b48a06
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
'assets' => 'public/assets',
'cache' => 'tmp/cache',
'pids' => 'tmp/pids',
'log' => 'log'
'log' => 'log',
'vendor/bundle' => 'vendor/bundle'
}
default['defaults']['deploy']['create_dirs_before_symlink'] =
%w(tmp public config ../../shared/cache ../../shared/assets)
Expand Down
1 change: 1 addition & 0 deletions libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def every_enabled_rds

def perform_bundle_install(release_path)
bundle_path = "#{release_path}/../../shared/vendor/bundle"

execute 'bundle_install' do
command "/usr/local/bin/bundle install --deployment --without development test --path #{bundle_path}"
cwd release_path
Expand Down
1 change: 1 addition & 0 deletions recipes/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
create_deploy_dir(application, File.join('shared', 'pids'))
create_deploy_dir(application, File.join('shared', 'scripts'))
create_deploy_dir(application, File.join('shared', 'sockets'))
create_deploy_dir(application, File.join('shared', 'vendor/bundle'))

databases = []
every_enabled_rds do |rds|
Expand Down
4 changes: 4 additions & 0 deletions spec/unit/recipes/configure_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
it 'creates shared/sockets' do
expect(chef_run).to create_directory("/srv/www/#{aws_opsworks_app['shortname']}/shared/sockets")
end

it 'creates shared/vendor/bundle' do
expect(chef_run).to create_directory("/srv/www/#{aws_opsworks_app['shortname']}/shared/vendor/bundle")
end
end

context 'Postgresql + Git + Unicorn + Nginx + Sidekiq' do
Expand Down
3 changes: 2 additions & 1 deletion spec/unit/recipes/deploy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
'cache' => 'tmp/cache',
'pids' => 'tmp/pids',
'log' => 'log',
'test' => 'public/test'
'test' => 'public/test',
'vendor/bundle' => 'vendor/bundle'
},
'create_dirs_before_symlink' => %w(tmp public config ../../shared/cache ../../shared/assets ../shared/test),
'purge_before_symlink' => %w(log tmp/cache tmp/pids public/system public/assets public/test)
Expand Down

0 comments on commit 7b48a06

Please sign in to comment.