-
Notifications
You must be signed in to change notification settings - Fork 140
/
Copy pathCapfile
39 lines (31 loc) · 1004 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
31
32
33
34
35
36
37
38
39
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
default_run_options[:pty] = true
# be sure to change these
set :user, 'alexmchale'
set :domain, 'redis-db.com'
set :application, 'try.redis'
# the rest should be good
set :repository, "git://github.com/alexmchale/try.redis.git"
set :deploy_to, "/var/www/#{application}"
set :scm, 'git'
set :branch, 'master'
set :scm_verbose, true
set :use_sudo, true
server domain, :app, :web
namespace :deploy do
task :restart do
run "sudo /etc/init.d/apache2 restart"
end
end
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} && bundle install --without development test"
end
end
after 'deploy:update_code', 'bundler:bundle_new_release'