Skip to content

Instantly share code, notes, and snippets.

@michiels

michiels/deploy.rb

Last active Jan 4, 2016
Embed
What would you like to do?
Capistrano deploy.rb for Intercity
require 'bundler/capistrano'
set :application, ">> set application name <<"
set :repository, ">> change to your Git repository <<"
set :ssh_options, { forward_agent: true }
set :default_run_options, { pty: true }
set :user, "deploy"
set :use_sudo, false
set :default_environment, {
"PATH" => "/opt/rbenv/shims:/opt/rbenv/bin:$PATH"
}
server ">> your server address <<", :web, :app, :db, :primary => true
after "deploy:finalize_update", "link:database"
namespace :link do
task :database do
run "rm -f #{release_path}/config/database.yml"
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
end
end
after "deploy:restart", "deploy:cleanup"
namespace :deploy do
task :restart do
run "touch #{current_path}/tmp/restart.txt"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment