Coder Social home page Coder Social logo

post_hook's Introduction

Post Hook is a simple Sinatra template for use with Web Hooks

Post hook is currently setup to run under Phusion Passenger (though not required) for use with Github service hooks.

Requirements

Post hook relies on a number of rubygems: sinatra - well to run, it's a sinatra app after all rack - for logging active_support - for JSON parsing popen4 - for running shell commands and capturing the return values

Github Service Hook JSON template and example.

Current as of Wednesday, August 26th, 2009. See http://github.com/guides/post-receive-hooks for most up to date definition

JSON Template

{ :before => before, :after => after, :ref => ref, :commits => [{ :id => commit.id, :message => commit.message, :timestamp => commit.committed_date.xmlschema, :url => commit_url, :added => array_of_added_paths, :removed => array_of_removed_paths, :modified => array_of_modified_paths,
:author => { :name => commit.author.name, :email => commit.author.email } }], :repository => { :name => repository.name, :url => repo_url, :pledgie => repository.pledgie.id, :description => repository.description, :homepage => repository.homepage, :watchers => repository.watchers.size, :forks => repository.forks.size, :private => repository.private?,
:owner => { :name => repository.owner.login, :email => repository.owner.email } } }

JSON Example

{ "before": "5aef35982fb2d34e9d9d4502f6ede1072793222d", "repository": { "url": "http://github.com/defunkt/github", "name": "github", "description": "You're lookin' at it.", "watchers": 5, "forks": 2, "private": 1, "owner": { "email": "[email protected]", "name": "defunkt" } }, "commits": [ { "id": "41a212ee83ca127e3c8cf465891ab7216a705f59", "url": "http://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59", "author": { "email": "[email protected]", "name": "Chris Wanstrath" }, "message": "okay i give in", "timestamp": "2008-02-15T14:57:17-08:00", "added": ["filepath.rb"] }, { "id": "de8251ff97ee194a289832576287d6f8ad74e3d0", "url": "http://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0", "author": { "email": "[email protected]", "name": "Chris Wanstrath" }, "message": "update pricing a tad", "timestamp": "2008-02-15T14:36:34-08:00" } ], "after": "de8251ff97ee194a289832576287d6f8ad74e3d0", "ref": "refs/heads/master" }

post_hook's People

Stargazers

Tim Harrison avatar Dave Augustine avatar Brian Case avatar  avatar Jessie Johnson avatar Andrew Carpenter avatar Bob Burbach avatar Ray Baxter avatar

Watchers

Ray Baxter avatar Bob Burbach avatar WestEd Information Technology avatar Andrew Carpenter avatar Mark Nutini avatar Jessie Johnson avatar  avatar Brian Case avatar Dave Augustine avatar Tim Harrison avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.