Created
February 8, 2014 14:52
-
-
Save runesoerensen/8884870 to your computer and use it in GitHub Desktop.
New Relic deployment notification using AppHarbor configuration
This file contains hidden or 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
using (var webClient = new WebClient()) | |
{ | |
var appSettings = ConfigurationManager.AppSettings; | |
webClient.Headers.Add("x-license-key", appSettings["NEWRELIC_LICENSEKEY"]); | |
webClient.UploadValues(new Uri("https://api.newrelic.com/deployments.xml"), new NameValueCollection | |
{ | |
{ "deployment[app_name]", "My Application" }, | |
{ "deployment[user]", "AppHarbor" }, | |
{ "deployment[description]", string.Format("Deployment notification from {0}", appSettings["appharbor.worker_name"]) }, | |
{ "deployment[revision]", appSettings["appharbor.commit_id"] }, | |
{ "deployment[environment]", appSettings["Environment"] }, | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment