Created
June 19, 2014 23:11
-
-
Save timdorr/beaf0d247abb2c8a3391 to your computer and use it in GitHub Desktop.
Rollbar Deploy Rake Task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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