Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rollbar deploy notification using ENV variable from dotenv
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
You can’t perform that action at this time.