Skip to content

Instantly share code, notes, and snippets.

@wilsontayar
Forked from kfrancis/gist:3164709
Last active December 30, 2015 05:48
Show Gist options
  • Save wilsontayar/7784690 to your computer and use it in GitHub Desktop.
Save wilsontayar/7784690 to your computer and use it in GitHub Desktop.
Fast way to send a deploy to New Relic using PowerShell. Just throw curl (http://curl.haxx.se/download.html) inside your %WINDIR%\system32 folder and [C:\newRelicDeploy.ps1 -User "John Doe" -Revision "v.6.6.6.0" -Changelog "list of changes in this version"].
param([String] $User, [String] $Revision, [String] $Description, [String] $Changelog)
$appID = "<your app id here>"
$apiKey = "<your api key here>"
"Sending deploy to New Relic API..."
$command = "curl -k -H 'x-api-key:$apiKey' -d 'deployment[application_id]=$appID' -d 'deployment[description]=$Description' -d 'deployment[revision]=$Revision' -d 'deployment[changelog]=$Changelog' -d 'deployment[user]=$User' https://api.newrelic.com/deployments.xml"
Invoke-Expression $command
@wilsontayar
Copy link
Author

New revision using curl. Just found it way easier than using System.Net.HttpWebRequest.
Anyway, you could always gitbash the curl as well. This is just a "parameterized" way of doing it. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment