Giter Club home page Giter Club logo

herald-gogshook's Introduction

Herald Gogshook Plugin

Herald daemon plugin for gogs hook.

The gogs_hook trigger will create a http server and wait for gogs webhook events. gogs_hook selector will try to match the repository parameters.

Installation

$ go get -d -u github.com/heraldgo/herald-gogshook

Build with

$ go build --buildmode=plugin github.com/heraldgo/herald-gogshook

Find herald-gogshook.so in the current directory.

Configuration

The plugin file herald-gogshook.so must be specified in the herald daemon configuration.

plugin:
  - /plugin_directory/herald-gogshook.so

trigger:
  gogs_hook:
    secret: 'xxxxxxxxxxxxxxxx'
    port: 8234

router:
  deploy:
    trigger: gogs_hook
    selector: gogs_hook
    job:
      print_param: print
    gogs_host: gogs.example.com
    gogs_name: heraldgo/heraldd
    gogs_branch: master
    gogs_event: push

Go to the Gogs project settings and select the "Webhooks" page, then click "Add Webhook" and choose "Gogs". Input the URL in "Payload URL": http://example.com:8234. "Content type" must be "application/json". The "secret" must be exactly the same as in the trigger configuration.

More than one projects could point the "payload URL" to the same gogs_hook trigger. The param starts with gogs_ will be used in the selector to match the required repository. Not all of these params are necessary, and only provided params will be used for matching.

gogs_hook trigger can also listen on unix socket, which could use nginx as the reverse proxy.

trigger:
  gogs_hook:
    secret: 'xxxxxxxxxxxxxxxx'
    unix_socket: /var/run/heraldd/gogs_hook.sock

herald-gogshook's People

Contributors

xianghuzhao avatar

Watchers

 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.