Created
July 31, 2012 04:30
-
-
Save mattfordham/3213617 to your computer and use it in GitHub Desktop.
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
set :application, "example.com" | |
server "209.61.142.41", :app, :web, :db, :primary => true | |
set :deploy_to, "/srv/www/#{application}" | |
set :user, "root" | |
default_run_options[:pty] = true | |
set :repository, "ssh://git@bitbucket.org/mattfordham/capistrano.git" | |
set :scm, :git | |
set :branch, "master" | |
set :deploy_via, :remote_cache | |
set :copy_strategy, :checkout | |
set :keep_releases, 5 | |
# Deployment process | |
after "deploy", "deploy:create_symlinks", "deploy:set_permissions" | |
# Custom deployment tasks | |
namespace :deploy do | |
desc "This is here to override the original :restart" | |
task :restart, :roles => :app do | |
# do nothing but override the default | |
end | |
desc "Create symlinks to shared data such as config files and uploaded images" | |
task :create_symlinks, :roles => :app do | |
run "ln -s #{deploy_to}/#{shared_dir}/images #{current_release}/images" | |
run "ln -s #{deploy_to}/#{shared_dir}/database.php #{current_release}/system/expressionengine/config/database.php" | |
end | |
desc "Set the correct permissions for the config files and cache folder" | |
task :set_permissions, :roles => :app do | |
run "chmod 666 #{current_release}/index.php" | |
run "chmod 777 #{current_release}/system/expressionengine/cache/" | |
run "chmod 666 #{current_release}/system/expressionengine/config/config.php" | |
run "chmod 666 #{current_release}/system/expressionengine/config/database.php" | |
run "chmod 777 #{current_release}/system/expressionengine/templates/" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment