summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortekkub <tekkub@gmail.com>2009-10-16 20:44:29 -0600
committertekkub <tekkub@gmail.com>2009-10-16 20:44:29 -0600
commite57d371b93f2e46a06ea592b2dcef2b5063cf92e (patch)
tree4e4f2a04cc8cb68d33e1bfcc9da59cd2634b181c
parent9f237f1ff8326de74e4640c460f095cbff6aa7f3 (diff)
Add post-receive hook guide
-rw-r--r--_posts/2009-10-16-post-receive-hooks.textile34
-rwxr-xr-xcss/style.css7
2 files changed, 41 insertions, 0 deletions
diff --git a/_posts/2009-10-16-post-receive-hooks.textile b/_posts/2009-10-16-post-receive-hooks.textile
new file mode 100644
index 0000000..ae27cfc
--- /dev/null
+++ b/_posts/2009-10-16-post-receive-hooks.textile
@@ -0,0 +1,34 @@
+---
+layout: default
+title: Post-Receive Hooks
+description: Working with GitHub's post-receive web hooks.
+categories: collaborating
+---
+
+If you supply a post-receive URL, GitHub will POST to that URL when someone uses <code>git push</code> on that repository.
+
+<img src="http://img.skitch.com/20090814-ksn6tk94h8is3ddgsxmsmuxk4s.jpg"/>
+
+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:
+
+<script src="http://gist.github.com/212213.js"></script>
+
+This is sent as a POST with a single parameter: 'payload'
+
+So, for example, you'd do something like this in a <a href="http://sinatra.rubyforge.org/">Sinatra</a> server:
+
+<script src="http://gist.github.com/212212.js"></script>
+
+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:
+
+<script src="http://gist.github.com/212211.js"></script>
+
+For more information on this technique, see the <a href="http://webhooks.pbwiki.com/">Web Hooks Wiki</a>. \ No newline at end of file
diff --git a/css/style.css b/css/style.css
index d8dc77b..75ca198 100755
--- a/css/style.css
+++ b/css/style.css
@@ -47,3 +47,10 @@ pre.terminal {
}
code {white-space: nowrap;}
+
+
+/********************/
+/* Images */
+/********************/
+
+.wikistyle img {max-width: 690px;}