Code Monkey home page Code Monkey logo

django-github-hook's Introduction

github_hook

Simple continuous integration for Django developers, taking the form of a Django app for managing GitHub (or BitBucket) post receive hooks.

https://travis-ci.org/sheppard/django-github-hook.svg?branch=master

Tested on Python 2.7 and 3.4, with Django 1.6 and 1.7.

Usage

  • pip install django-github-hook
  • Add github_hook to INSTALLED_APPS in your settings.py
  • ./manage.py migrate (or ./manage.py syncdb)
  • Add e.g. url(r'^hook/', include('github_hook.urls')) to your urls.py urlpatterns
  • Log into the Django admin console
  • Configure your hook with the folowing fields:
    • Name: Hook identifier
    • User: Repo username
    • Repo: Repo name
    • Path: Absolute path to script to execute
  • Go to your repo's "Service Hooks" settings on GitHub (or BitBucket) and add a WebHook/POST URL:
    • http[s]://[yourwebsite]/hook
    • The repo information will be read from the JSON payload
  • Alternatively, you can specify a specific hook by name:
    • http[s]://[yourwebsite]/hook/name

Examples

The following snippet show how to connect the webhook to a method using django's signal mechanism. Note that path must be set to "send-signal" in the hook object instead of an absolute path to a script.

from github_hook.models import hook_signal

def processWebhook(sender, **kwargs):
        for key, value in kwargs.iteritems():
                print key, value

hook_signal.connect(processWebhook)

django-github-hook's People

Contributors

sheppard avatar philippeowagner avatar

Watchers

Chris McBride 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.