mig (owner)

Revisions

gist: 227325 Download_button fork
public
Public Clone URL: git://gist.github.com/227325.git
Embed All Files: show embed
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
40
41
require 'capistrano/version'
load 'deploy'
 
# Customize the following variables
set :domain, "host.example.com"
set :user, "username"
set :application, "my_wordpress_blog"
set :deploy_to, "/var/www/apps/#{application}"
 
# These variables probably don't need to change
set :repository, "file://#{File.expand_path('.')}"
server "#{domain}", :app, :web, :db, :primary => true
set :deploy_via, :copy
set :copy_exclude, [".git", ".DS_Store"]
set :scm, :git
set :branch, "master"
set :use_sudo, false
set :keep_releases, 2
set :git_shallow_clone, 1
 
namespace :deploy do
  task :default do
    transaction do
      update_code
      symlink
    end
  end
 
  task :update_code, :except => { :no_release => true } do
    on_rollback { run "rm -rf #{release_path}; true" }
    strategy.deploy!
  end
 
  task :after_deploy do
    cleanup
  end
 
  task :after_symlink do
    run "ln -nfs #{shared_path}/uploads/#{current_path}/public/wp-content/uploads"
  end
end