Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions lib/tasks/newrelic.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace :newrelic do
##
# This task is essentially the same as running the following:
#
# bundle exec newrelic deployment -r $(git rev-parse HEAD)
#
# The reason for the rake task is that our `newrelic.yml` file contains ERB
# blocks that expect the AppConfig to be setup and for identity-hostdata to be
# loaded. This rake task loads the rails environment before reporting the
# deployment so the NewRelic config is loaded correctly.
#
desc 'Report a new deployment to NewRelic'
task deployment: :environment do
require 'new_relic/cli/command'
revision = `git rev-parse HEAD`.chomp
NewRelic::Cli::Deployments.new(revision: `git rev-parse HEAD`).run
end
end