Skip to content

Instantly share code, notes, and snippets.

@alq666
Created July 9, 2012 22:10
Show Gist options
  • Save alq666/3079351 to your computer and use it in GitHub Desktop.
Save alq666/3079351 to your computer and use it in GitHub Desktop.
post-receive git hook on the command line

Verify the git configuration

git config --get datadog.api
git config --get datadog.application

Both should return one key (API and application respectively).

Go to a git repo

cd my-git-repo

extract the last 2 commits and submit to Datadog

git log --reverse HEAD~~..HEAD | awk '/commit/ {print $2} END {print "master"}' > post-receive-args

run the commit hook with these arguments

cat post-receive-args | post-receive-datadog

you should see something like this

hook

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