Last active
January 29, 2016 00:39
Rollbar deploy notification using ENV variable from dotenv
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
require 'dotenv/tasks' | |
task notify_rollbar: :dotenv do | |
on roles(:app) do |h| | |
revision = `git log -n 1 --pretty=format:"%H"` | |
local_user = `whoami`.chomp | |
rollbar_token = ENV['ROLLBAR_ACCESS_TOKEN'] | |
rails_env = fetch(:rails_env, 'production') | |
execute :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 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment