Created
February 11, 2014 11:52
-
-
Save plukevdh/8933489 to your computer and use it in GitHub Desktop.
Deployment notification to NewRelic from OctoDeploy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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