public
Description: The code for MyChores, open-source, freely available to anyone who wants it.
Homepage: http://www.mychores.co.uk
Clone URL: git://github.com/sermoa/mychores.git
Click here to lend your support to: mychores and make a donation at www.pledgie.com !
mychores / Capfile
100644 31 lines (23 sloc) 1.259 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
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy'
 
after 'deploy:symlink', 'deploy:finishing_touches'
 
namespace :deploy do
 
  task :start, :roles => :app do
    run "rm -rf /home/#{user}/public_html;ln -s #{current_path}/public /home/#{user}/public_html"
    run "cd #{current_path} && mongrel_rails start -e production -p #{mongrel_port} -d"
  end
 
  task :restart, :roles => :app do
    run "cd #{current_path} && mongrel_rails stop && mongrel_rails start -e production -p #{mongrel_port} -d"
  end
  
   task :finishing_touches, :roles => :app do
    run "cp -pf #{deploy_to}/to_copy/.htaccess #{current_path}/public/.htaccess"
    run "cp -pf #{deploy_to}/to_copy/environment.rb #{current_path}/config/environment.rb"
    run "cp -pf #{deploy_to}/to_copy/database.yml #{current_path}/config/database.yml"
    run "cp -pf #{deploy_to}/to_copy/exceptional.yml #{current_path}/config/exceptional.yml"
    run "rm -rf #{current_path}/public/pictures"
    run "ln -s #{deploy_to}/pictures #{current_path}/public/pictures"
    run "ln -s #{deploy_to}/exports #{current_path}/public/exports"
    run "chmod 0755 #{current_path}/public/dispatch.*"
  end
 
end