Skip to content

Instantly share code, notes, and snippets.

@mattfordham
Created July 31, 2012 04:30
Show Gist options
  • Save mattfordham/3213617 to your computer and use it in GitHub Desktop.
Save mattfordham/3213617 to your computer and use it in GitHub Desktop.
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