newrelic/rpm — pull request #119 by chrismar035 (2013-05-09 21:10:24+00:00)
Title: Allow license key to be set or overridden by Capistrano variables

We use two different linked New Relic accounts for managing our staging (Lite account) and production (Pro account) servers/apps. The same Rails codebase runs on servers in both the Lite and Pro accounts. We are specifying the `newrelic_appname` Capistrano variable and the Pro license key in the `newrelic.yml`. As a result, the apps in the Lite account do not get deploy notices, since those app names are not found associated with the Pro license key.

This Pull Request allows New Relic license keys to be specified in the `deploy.rb` or from the command line. For example:
~~~ruby
#deploy.rb
set :newrelic_appname, 'staging_app_name'
set :newrelic_license_key, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
after "deploy:create_symlink", "newrelic:notice_deployment"
~~~

~~~bash
ruby vendor/plugins/newrelic_rpm/bin/newrelic deployments --license-key="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
~~~