Created
June 30, 2009 09:40
-
-
Save jacobat/138094 to your computer and use it in GitHub Desktop.
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
| set :application, "[application name here]" | |
| set :repository, "." | |
| set :deploy_to, "[where you want the code to go]" | |
| set :scm, :git | |
| set :branch, "master" | |
| set :use_sudo, false | |
| set :deploy_via, :copy | |
| set :copy_cache, true | |
| set :copy_exclude, [".git", "materials"] | |
| set :www_user, "[name of the user the webserver runs as]" | |
| role :app, "[servername]" | |
| role :web, "[servername]" | |
| role :db, "[servername]", :primary => true | |
| namespace :deploy do | |
| task :update do | |
| transaction do | |
| update_code | |
| symlink | |
| end | |
| end | |
| task :finalize_update do | |
| transaction do | |
| run "chmod -R g+w #{releases_path}/#{release_name}" | |
| end | |
| end | |
| task :symlink do | |
| transaction do | |
| run "ln -nfs #{current_release} #{deploy_to}/#{current_dir}" | |
| run "ln -nfs #{current_release}/config/apache.conf /usr/local/etc/apache22/sites/#{application}.conf" | |
| run "rm -rf #{current_release}/public/wp-content/uploads" | |
| run "ln -nfs #{shared_path}/uploads #{current_release}/public/wp-content/uploads" | |
| run "ln -nfs #{shared_path}/htaccess #{current_release}/public/.htaccess" | |
| end | |
| end | |
| task :migrate do | |
| # nothing | |
| end | |
| task :restart do | |
| # nothing | |
| end | |
| task :setup_upload_dir do | |
| run "mkdir -p #{shared_path}/uploads" | |
| sudo "chgrp #{www_user} #{shared_path}/uploads" | |
| run "touch #{shared_path}/htaccess" | |
| sudo "chgrp #{www_user} #{shared_path}/htaccess" | |
| end | |
| end | |
| after "deploy:setup", "deploy:setup_upload_dir" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment