Git Product home page Git Product logo

githookhub's Introduction

=head1 NAME

GHH - Git update hook hub

=head1 EXAMPLE

C<hooks/update> of your Git repository:

  #!/bin/sh
  git_dir=`cd $GIT_DIR; pwd`
  git_dir=${git_dir#/var/git}
  commits=`git log --pretty=format:%H $2^..$3`
  
  curl http://ghhserver/ \
      --data-urlencode "refname=$1" \
      --data-urlencode "commits=$commits" \
      --data-urlencode "url=git://`hostname`$git_dir"
  true

C<config/rules/hook1.json>:

  {
    "name": "hook1",
    "can_make": "test",
    "has_file": "config/foo.dat",
    "http_post": "http://hogeserver/fuga",
    "args": [1, 2, 3, {"foo": "bar"}]
  }

Setup dependency:

  $ make deps

Then, start the server:

  $ GHH_RULES_D=config/rules ./plackup -s Twiggy bin/server.psgi -p 4155

Note that Starman, Starlet, and Twiggy::Prefork cannot handle the
application well.

Then, when something is pushed to the repository, and if the
repository meets the condition specified in C<hook1.json>, then the
URL specified in the C<http_post> field is accessed with JSON data,
whose format is similar to (but not completely equal to)
<https://help.github.com/articles/post-receive-hooks>.

=head1 AUTHOR

Wakaba (id:wakabatan) <[email protected]>.

=head1 LICENSE

Copyright 2012 Hatena <http://www.hatena.ne.jp/>.

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

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.