Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save driesvints/32b51e4276d16f178449 to your computer and use it in GitHub Desktop.
Save driesvints/32b51e4276d16f178449 to your computer and use it in GitHub Desktop.
Setup New Relic deployment notifications in Envoyer

While Envoyer comes with Slack and Hipchat notifications out of the box we'll have to setup New Relic notifications ourselves. Luckily it's as easy as adding a deployment hook. Here's how to:

  1. Add a new hook after the "Activate New Release" hook.
  2. Add the following curl command as the script:
curl -H "x-api-key:REPLACE_WITH_YOUR_API_KEY" -d "deployment[app_name]=REPLACE_WITH_YOUR_APP_NAME" https://api.newrelic.com/deployments.xml

And that's it! Envoyer will now let New Relic know each time a deployment's made. You can be sure the deployment succeeded because it happens after the new release has been made active.

For more info check out the New Relic documentation.

@nesl247
Copy link

nesl247 commented Aug 5, 2015

The only downside is the extremely limited API from Envoyer means we can't put in the revision, commit message, etc. in the call. Envoyer really needs to add more than {{release}} to it's list of variables.

@driesvints
Copy link
Author

@nesl247 true, there's always room for improvement. Perhaps @taylorotwell can add some more variables over time. I'm sure he has considered it.

@crishoj
Copy link

crishoj commented Oct 26, 2020

Commit hash is available as {{ sha }} according to https://docs.envoyer.io/1.0/projects/deployment-hooks.html

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