Giter Club home page Giter Club logo

githookproxy's Introduction

Git Hook Proxy

Motivation

To help integrate Gitlab post receive hook and do further CI with something like Jenkins.

Gitlab sends a webhook as an 'application/json' post, with the JSON as part of the post body. This makes it harder for Jenkins to read, as it usually expects parameters. This is slightly different from Github, which posts it as a 'payload' parameter.

Git hook proxy takes the Gitlab web hook and translates it into something more easily workable by Jenkins.

To Run proxy

go build proxy.go

This will generate a 'proxy' executable.

To run the proxy:

./proxy -listen <listen address>

For Example:

./proxy -listen 127.0.0.1:9999

To use proxy

Add this to your Gitlab webook:

http://[proxy_listen_url]?url=[target_url]

Make sure to specify 'url' parameter to tell the proxy where to forward requests to.

The proxy will take the webhook request, and translate it to a request to the target_url in the format of:

  • payload: JSON body
  • START: Start commit hash
  • END: End commit hash
  • REFNAME: Ref name

githookproxy's People

Contributors

akira avatar ml0renz0 avatar

Watchers

 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.