Created
October 3, 2012 21:09
-
-
Save barnaclebarnes/3829859 to your computer and use it in GitHub Desktop.
Capistrano deploy for WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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