Skip to content

Instantly share code, notes, and snippets.

@brianr
Forked from mertonium/deploy.rb
Created December 4, 2012 15:57
Show Gist options
  • Save brianr/4205455 to your computer and use it in GitHub Desktop.
Save brianr/4205455 to your computer and use it in GitHub Desktop.
Capistrano task to notify Ratchet.io about deployment
# I am trying out Ratchet.io and I want to add their deployment notification to my
# normal capistrano deployment process. Here is my first working attempt.
# Add this task to your deploy.rb
task :notify_ratchetio, :roles => :app do
set :revision, `git log -n 1 --pretty=format:"%H"`
set :local_user, `whoami`
set :ratchetio_token, YOUR_ACCESS_TOKEN
rails_env = fetch(:rails_env, "production")
run "curl https://submit.ratchet.io/api/1/deploy/ -F access_token=#{ratchetio_token} -F environment=#{rails_env} -F revision=#{revision} -F local_username=#{local_user}", :once => true
end
# Then add this task to your deployment flow, i.e.
after :deploy, 'notify_ratchetio'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment