mikamai / barmanitto

This URL has Read+Write access

pilu (author)
Sat May 09 05:15:24 -0700 2009
commit  5158637e0c5821a609d60390e5ff91d4d0d757b3
tree    ffe6f1a4011455908bf35c4c364ddea25d4b418a
parent  ad84a6a108050c969bb9c73615fa7b0d8b530326
barmanitto / Capfile
100644 47 lines (36 sloc) 1.215 kb
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
40
41
42
43
44
45
46
47
load 'deploy' if respond_to?(:namespace)
 
set :application, "barmanitto.com"
set :repository, "git@github.com:mikamai/barmanitto.git"
set :deploy_to, "/var/apps/#{application}"
 
set :scm, :git
set :branch, "master"
set :repository_cache, "git_master_branch"
set :deploy_via, :remote_cache
 
set :user, 'rails'
set :use_sudo, false
set :runner, 'rails'
 
role :app, "barmanitto.com:8888"
role :web, "barmanitto.com:8888"
role :db, "barmanitto.com:8888", :primary => true
 
 
namespace :deploy do
after "deploy:symlink", "deploy:bar_manitto:symlink"
 
task :finalize_update, :except => { :no_release => true } do
  end
   
namespace :bar_manitto do
task :symlink do
%w[tmp db].each do |folder|
run "cd #{shared_path}; mkdir -p #{folder}; cd #{current_path}; rm -rf #{folder}; ln -s #{shared_path}/#{folder} #{folder}"
end
run "cd #{current_path}/config; rm -rf config.yml; ln -s #{shared_path}/config.yml config.yml"
end
end
end
 
deploy.task :restart, :roles => :app do
  run "touch #{current_path}/tmp/restart.txt"
end
 
deploy.task :start, :roles => :app do
  # nothing to do here
end
 
deploy.task :stop, :roles => :app do
  # nothing to do here
end