Skip to content

Instantly share code, notes, and snippets.

@sohooo
Forked from mig/Capfile
Created January 24, 2010 10:29
Show Gist options
  • Save sohooo/285133 to your computer and use it in GitHub Desktop.
Save sohooo/285133 to your computer and use it in GitHub Desktop.
Wordpress Capistrano task
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