Sha256: 4b40810a75d2dfa303a7d5e6491e88b07486f0857cff3e995db63e2b33090a9a

Contents?: true

Size: 797 Bytes

Versions: 24

Compression:

Stored size: 797 Bytes

Contents

namespace :newrelic do
  desc 'Notifies New Relic that a deployment has occurred'
  task notice_deployment: :environment do
    begin
      require 'newrelic_rpm'
      require 'new_relic/cli/command'

      appname = ENV.fetch('NEW_RELIC_APP_NAME')

      Rails.logger.info("Notifying New Relic of deployment to #{appname}")
      NewRelic::Cli::Deployments.new(
        environment: Rails.env.to_s,
        revision: ENV.fetch('SOURCE_VERSION', 'unknown'),
        changelog: '',
        description: '',
        appname: appname,
        user: '',
        license_key: ENV.fetch('NEW_RELIC_LICENSE_KEY')
      ).run
    rescue => e
      Rails.logger.error("Failed to notify New Relic (#{e.class.name}: #{e.message})")
      Rails.logger.info(e.backtrace.take(10).join("\n"))
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
roo_on_rails-1.22.0 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.21.0 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.20.0 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.19.0 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.18.0 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.17.0 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.16.2 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.16.1 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.16.0 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.15.0 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.14.0 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.13.1 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.13.0 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.12.0 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.11.1 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.11.0 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.10.0 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.9.0 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.8.1 lib/roo_on_rails/tasks/newrelic.rake
roo_on_rails-1.8.0 lib/roo_on_rails/tasks/newrelic.rake