Created
October 30, 2010 12:41
-
-
Save simkimsia/655260 to your computer and use it in GitHub Desktop.
deploy.rb for copying files after deploy for staging
This file contains 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
# 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