Skip to content

Instantly share code, notes, and snippets.

@rpunt
Created April 29, 2014 14:31
Show Gist options
  • Save rpunt/11402142 to your computer and use it in GitHub Desktop.
Save rpunt/11402142 to your computer and use it in GitHub Desktop.
Post deployment info the NewRelic
# New Relic deployment events
my $ua = LWP::UserAgent->new;
$response = $ua->request(POST 'https://api.newrelic.com/deployments.xml',
Content => [
'deployment[application_id]' => $APPID,
'deployment[description]' => 'deployment message',
'deployment[revision]' => $RELEASE_VERSION,
'deployment[user]' => 'Jenkins'
],
'x-api-key' => $APIKEY
);
if ($response->is_success) {
print $response->decoded_content;
} else {
print $response->headers_as_string . "\n";
die $response->status_line;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment