Skip to content

Instantly share code, notes, and snippets.

@michiels
Last active January 4, 2016 18:59
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 michiels/8664003 to your computer and use it in GitHub Desktop.
Save michiels/8664003 to your computer and use it in GitHub Desktop.
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