Skip to content

Instantly share code, notes, and snippets.

@mig
Created Nov 5, 2009
Embed
What would you like to do?
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment