Skip to content

Instantly share code, notes, and snippets.

@plukevdh
Created February 11, 2014 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plukevdh/8933489 to your computer and use it in GitHub Desktop.
Save plukevdh/8933489 to your computer and use it in GitHub Desktop.
Deployment notification to NewRelic from OctoDeploy
$headers = @{"x-api-key"="$OctopusParameters['NewRelic.APIKey']"}
$key = "NewRelic." + $OctopusParameters['Octopus.Project.Name'] + ".ID"
$body = @{
"deployment[user]"="$OctopusParameters['Octopus.Deployment.CreatedBy.DisplayName']";
"deployment[revision]"="$OctopusParameters['Octopus.Release.Number']";
"deployment[description]"="$OctopusParameters['Octopus.Release.Notes']";
"deployment[application_id]"="$OctopusParameters[$key]";
}
Invoke-RestMethod -Uri https://api.newrelic.com/deployments.xml -Headers $headers -Body $body -Method Post -ContentType "application/x-www-form-urlencoded"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment