Created
August 21, 2015 14:18
-
-
Save Jamedjo/640e537061410351c7a7 to your computer and use it in GitHub Desktop.
NewRelic git deployment hook
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
#!/bin/bash | |
production="refs/heads/production" | |
apikey="0001230120301203012030120301230" | |
application_id="1234567" | |
user=$(git config user.name) | |
while read local_ref local_sha remote_ref remote_sha | |
do | |
if [ "$remote_ref" == $production ]; then | |
curl -H "x-api-key:$apikey" -d "deployment[application_id]=$application_id" -d "deployment[revision]=$local_sha" -d "deployment[user]=$user" https://api.newrelic.com/deployments.xml | |
fi | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment