Code Monkey home page Code Monkey logo

notify-hook's Introduction

notify-hook

Build Status

Git post-receive hook to send GitHub PushEvent-formatted requests

Note, some github-specific payload fields are missing. The exact payload format can be found in payload.rs.

See releases for binaries, or build from source (see Releases section below). If you've installed a pre-compiled binary, you can update to the latest release via notify-hook self update.

Sidenote: This is a rewrite of the python utility notify-webhook


Configuration Options

Note: options are set (from within the git project) with:

git config notifyhook.hook-urls "https://httpbin.org/post,https://httpbin.org/post"

notifyhook.repo-name

Repository name to use. Defaults to blank


notifyhook.repo-description

Repository description to use. Defaults to blank


notifyhook.repo-owner-name

Repository owner name to use. Defaults to blank


notifyhook.repo-owner-email

Repository owner email to use. Defaults to blank


notifyhook.hook-urls

Comma separated list of urls to post content to.


notifyhook.secret-token

Optional: Hex encoded secret token used to generate a GitHub X-Hub-Signature header.


notifyhook.content-type

Content type to send payload as. Defaults to urlencoded.

Options:

  • urlencoded: (Default) Post as application/x-www-form-urlencoded
  • json: Post as application/json

Development

  • Install rust
  • cargo build
  • echo "6b1bc10c d7b4c1baba master" | cargo run -- --debug

Releases

Statically compiled releases are built by travis-ci with --features update to allow notify-hook self update. If you want to fork this project and continue building/self-updating with your github releases, you'll need to enable the notify-hook repository in your travis-ci account and then update the update function to point to your forked github repository.

If you prefer to build locally, there are two options:

  1. If your build and target architectures are identical, you can get away with a simple cargo build --release. Note, this requires libssl-dev to be installed in your build environment, and openssl installed on your target.
  2. If you want to build static releases, like those built by travis-ci, you can use the build-release.py script. This script requires docker and cross to be installed to produce statically compiled binaries. By default, artifacts will be produced for i686 and x86_64. This can be tweaked in the TARGETS list of build-release.py.
    • Install docker
      • Add yourself to the docker group: sudo usermod -a -G docker <user>
      • Restart to pick up changes (logging in & out may suffice)
      • You should be able to run docker version without any errors
      • May need to start the Docker daemon if it's not already running: sudo systemctl start docker
    • Install cross: cargo install cross
    • ./build-release.py
      • Release artifacts (i686 & x86_64) will be copied into bin/32 & bin/64

notify-hook's People

Contributors

jaemk avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

icodein

notify-hook's Issues

blank repo name

remote.origin.url config value is not set on remote repos so repo name defaults to blank.

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.