Skip to content

Instantly share code, notes, and snippets.

@sagmor
Created November 28, 2009 20:11
Show Gist options
  • Save sagmor/244632 to your computer and use it in GitHub Desktop.
Save sagmor/244632 to your computer and use it in GitHub Desktop.
Cake PHP Capfile example
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
load 'app/config/deploy'
namespace :deploy do
task :restart do
# How to restart Your Server
end
task :finalize_update do
['secret','database'].each do |config|
run "ln -s #{shared_path}/config/#{config}.php #{release_path}/app/config/#{config}.php"
end
run "chmod -R a+w #{release_path}/app/tmp"
run "rm -rf #{release_path}/app/webroot/files"
run "ln -s #{shared_path}/files #{release_path}/app/webroot/files"
run "rm #{release_path}/{.htaccess,app/.htaccess,app/webroot/.htaccess}"
end
end
set :application, "APP_NAME"
set :user, 'SERVER_USER_NAME'
default_run_options[:pty] = true
set :scm, "git"
set :repository, "GITREPO"
set :branch, "master"
set :deploy_via, :remote_cache
set :deploy_to, '/ROUTE/TO/APP'
set :use_sudo, false
role :app, "SERVER_ADDRES"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment