Skip to content

Instantly share code, notes, and snippets.

@barnaclebarnes
Created October 3, 2012 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barnaclebarnes/3829859 to your computer and use it in GitHub Desktop.
Save barnaclebarnes/3829859 to your computer and use it in GitHub Desktop.
Capistrano deploy for WordPress
require 'railsless-deploy'
set :application, "[app name]"
set :use_sudo, false
#info for GIT
set :repository, "[git repo]"
set :scm, :git
set :branch, "master"
set :deploy_via, :remote_cache
set :user, "deploy"
set :deploy_to, "/srv/www/#{application}"
#Everything deployed to the same server
role :app, '[server]'
role :web, '[server]'
role :db, '[server]', :primary => true
set :runner, user
after "deploy:symlink", "devour:symlink"
namespace :devour do
task :symlink, :roles => :app do
# #Copy across our news settings
run "rm -rf #{release_path}/public/wp-config.php"
run "ln -nfs #{deploy_to}/#{shared_dir}/config/wp-config.php #{release_path}/public/"
#and the uploads folder
run "rm -rf #{release_path}/public/wp-content/uploads"
run "ln -nfs #{deploy_to}/#{shared_dir}/data/uploads #{release_path}/public/wp-content/uploads"
run "touch #{release_path}/public/sitemap.xml"
run "touch #{release_path}/public/sitemap.xml.gz"
run "chmod 777 #{release_path}/public/sitemap.xml"
run "chmod 777 #{release_path}/public/sitemap.xml.gz"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment