update deploy.rb.sample

This commit is contained in:
Vokhmin Alexey V 2013-09-27 16:09:18 +04:00
parent e471c135d2
commit 17cbeb3d7f
1 changed files with 9 additions and 1 deletions

View File

@ -10,7 +10,6 @@ set :default_environment, {
require 'rvm/capistrano'
require 'bundler/capistrano'
require 'airbrake/capistrano'
set :whenever_command, "bundle exec whenever"
# require "whenever/capistrano"
@ -86,6 +85,7 @@ after "deploy:start", "resque:start"
after "deploy:restart", "resque:restart"
after "deploy:restart", "deploy:cleanup"
after :deploy, 'notify_rollbar'
namespace :rake_tasks do
Cape do
@ -93,6 +93,14 @@ namespace :rake_tasks do
end
end
task :notify_rollbar, :roles => :app do
set :revision, `git log -n 1 --pretty=format:"%H"`
set :local_user, `whoami`
set :rollbar_token, 'rollbar_token'
rails_env = fetch(:rails_env, 'production')
run "curl https://api.rollbar.com/api/1/deploy/ -F access_token=#{rollbar_token} -F environment=#{rails_env} -F revision=#{revision} -F local_username=#{local_user} >/dev/null 2>&1", :once => true
end
namespace :update do
desc "Copy remote production shared files to localhost"
task :shared do