From 36602cc09ff614e0c1a0f61c1c72e7765e0dd1d4 Mon Sep 17 00:00:00 2001 From: tekkub Date: Sun, 20 Jun 2010 14:09:43 -0600 Subject: New pics for the hookers --- _posts/2009-10-16-post-receive-hooks.markdown | 42 +++++++++++++++++++++++++++ _posts/2009-10-16-post-receive-hooks.textile | 36 ----------------------- 2 files changed, 42 insertions(+), 36 deletions(-) create mode 100644 _posts/2009-10-16-post-receive-hooks.markdown delete mode 100644 _posts/2009-10-16-post-receive-hooks.textile (limited to '_posts') diff --git a/_posts/2009-10-16-post-receive-hooks.markdown b/_posts/2009-10-16-post-receive-hooks.markdown new file mode 100644 index 0000000..8826423 --- /dev/null +++ b/_posts/2009-10-16-post-receive-hooks.markdown @@ -0,0 +1,42 @@ +--- +layout: default +title: Post-Receive Hooks +description: Working with GitHub's post-receive web hooks. +categories: collaborating +--- + +_For help testing webhooks, see [this guide](/testing-webhooks)_ + +If you supply a post-receive URL, GitHub will POST to that URL when someone uses `git push` on that repository. + +![](http://img.skitch.com/20100620-r8st7468q7q5waf3y85hmpwtqs.png) + +![](http://img.skitch.com/20100620-br6dw5iiyk2643fahkqbi54h36.png) + +What we'll send is JSON containing information about the push and the commits involved. + +Here's the template we use in Ruby to generate the JSON: + + + +This is sent as a POST with a single parameter: 'payload' + +So, for example, you'd do something like this in a [Sinatra](http://sinatra.rubyforge.org/) server: + + + +The `commits` array is ordered with the most recent commit as the first element. The last element, therefor, is the oldest commit. + +Here's an example payload: + + + +For more information on this technique, see the [Web Hooks Wiki](http://webhooks.pbwiki.com/). + +Links +----- + +* [raggi/github_post_receive_server](http://github.com/raggi/github_post_receive_server/) -- A template Rack server +* [jnewland/github-campfire](http://github.com/jnewland/github-campfire/) +* [webs/irccat](http://github.com/webs/irccat) +* [jnunemaker/github-twitter](http://github.com/jnunemaker/github-twitter/) diff --git a/_posts/2009-10-16-post-receive-hooks.textile b/_posts/2009-10-16-post-receive-hooks.textile deleted file mode 100644 index 056ccb1..0000000 --- a/_posts/2009-10-16-post-receive-hooks.textile +++ /dev/null @@ -1,36 +0,0 @@ ---- -layout: default -title: Post-Receive Hooks -description: Working with GitHub's post-receive web hooks. -categories: collaborating ---- - -p(. _For help testing webhooks, see "this guide":/testing-webhooks_ - -If you supply a post-receive URL, GitHub will POST to that URL when someone uses git push on that repository. - - - -What we'll send is JSON containing information about the push and the commits involved. - -Here's the template we use in Ruby to generate the JSON: - - - -This is sent as a POST with a single parameter: 'payload' - -So, for example, you'd do something like this in a Sinatra server: - - - -A template Rack server for the task: "raggi/github_post_receive_server":http://github.com/raggi/github_post_receive_server/ - -Send something to "Campfire":http://github.com/jnewland/github-campfire/, "IRC":http://github.com/webs/irccat, "Twitter":http://github.com/jnunemaker/github-twitter/, your CI server, whatever. It's your data. - -The @commits@ array is ordered with the most recent commit as the first element. The last element, therefor, is the oldest commit. - -Here's an example of a POST'd 'payload' JSON object: - - - -For more information on this technique, see the Web Hooks Wiki. \ No newline at end of file -- cgit v1.3.1