Skip to content

Instantly share code, notes, and snippets.

@krisleech
Created February 1, 2012 10:08
Show Gist options
  • Select an option

  • Save krisleech/1716323 to your computer and use it in GitHub Desktop.

Select an option

Save krisleech/1716323 to your computer and use it in GitHub Desktop.

Revisions

  1. krisleech created this gist Feb 1, 2012.
    11 changes: 11 additions & 0 deletions newrelic_deployment.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    # config(:branch) returns the branch being deployed.
    # The newrelic command can accept an appname or appid, its undocumented, but it works.
    # The appid can be found in the URL after logging in to NewRelic.

    def notify_newrelic
    sha1 = (`git rev-parse #{config(:branch)}`).chomp
    description = (`git log #{config(:branch)} -1 --format="%s"`).chomp
    command = "bundle exec newrelic deployments --appname=#{config(:application_id)} --revision=#{sha1} '#{description}'"
    puts command
    system command
    end