-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCapfile
30 lines (25 loc) · 825 Bytes
/
Capfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy'
namespace :bundler do
task :create_symlink, :roles => :app do
shared_dir = File.join(shared_path, 'bundle')
release_dir = File.join(current_release, '.bundle')
run("mkdir -p #{shared_dir} && ln -s #{shared_dir} #{release_dir}")
end
task :bundle_new_release, :roles => :app do
bundler.create_symlink
run "cd #{release_path} && sudo bundle install --without test"
end
task :lock, :roles => :app do
run "cd #{current_release} && sudo bundle lock;"
end
task :unlock, :roles => :app do
run "cd #{current_release} && sudo bundle unlock;"
end
end
# HOOKS
after "deploy:update_code" do
bundler.bundle_new_release
# ...
end