Skip to content

Instantly share code, notes, and snippets.

@danbt79
Forked from mhayes/deploy.rb
Created March 11, 2013 18:41
Show Gist options
  • Save danbt79/5136544 to your computer and use it in GitHub Desktop.
Save danbt79/5136544 to your computer and use it in GitHub Desktop.
require 'capistrano/ext/multistage'
require "bundler/capistrano"
#use local key for authentication
ssh_options[:forward_agent] = true
default_run_options[:pty] = true
set :application, 'awesome'
set :repository, "[email protected]:zurb/awesome.git"
set :deploy_via, :remote_cache
set :scm, "git"
set :use_sudo, false
set :user, application
set :branch, 'master'
after "deploy:update_code", "db:symlink"
# if you're symlinking production database.yml do this
before "deploy:assets:precompile", "db:symlink"
namespace :db do
desc "Make symlink for database yaml"
task :symlink do
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
end
end
namespace :deploy do
desc "Restart Application"
task :restart, :roles => :app 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