Skip to content

Instantly share code, notes, and snippets.

@timdorr
Created June 19, 2014 23:11
Show Gist options
  • Save timdorr/beaf0d247abb2c8a3391 to your computer and use it in GitHub Desktop.
Save timdorr/beaf0d247abb2c8a3391 to your computer and use it in GitHub Desktop.
Rollbar Deploy Rake Task
namespace :deploy do
desc "Tell Rollbar about the deploy"
task :rollbar => :environment do
git_revision = `git log -n 1 --pretty=format:"%H"`
git_user = `git log -1 --pretty=%an`
git_message = `git log -1 --pretty=%B`
res = HTTParty.post("https://api.rollbar.com/api/1/deploy/", body: {
access_token: Rollbar.configuration.access_token,
environment: "production",
revision: git_revision,
local_username: git_user,
comment: git_message
})
puts res.parsed_response["message"]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment