Skip to content

Instantly share code, notes, and snippets.

@simkimsia
Created October 30, 2010 12:41
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 simkimsia/655260 to your computer and use it in GitHub Desktop.
Save simkimsia/655260 to your computer and use it in GitHub Desktop.
deploy.rb for copying files after deploy for staging
# setting for staging environment
task :staging do
# If you aren't deploying to /u/apps/#{application} on the target
# servers (which is the default), you can specify the actual location
# via the :deploy_to variable:
set :deploy_to, "/var/www/staging"
after("deploy:default", :copy_config_files)
end
#Deployment tasks
namespace :deploy do
desc "Override the original :restart"
task :restart, :roles => :app do
clear_cache
end
desc "Override the original :migrate"
task :migrate do
end
end
namespace :clear_cache do
desc <<-DESC
Blow up all the cache files CakePHP uses, ensuring a clean restart.
DESC
task :default do
# Remove absolutely everything from TMP
run "rm -rf #{shared_path}/tmp/*"
# Create TMP folders
run "mkdir -p #{shared_path}/tmp/{cache/{models,persistent,views},sessions,logs,tests}"
end
end
namespace :copy_config_files do
task :default do
run "cp /home/deploy/staging/database.php #{current_path}/app/config/"
run "cp /home/deploy/staging/bootstrap.local.php #{current_path}/app/config/"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment