Giter Site home page Giter Site logo

rabbithook-builder's Introduction

RabbitHook Builder

Update running docker containers after a new image has been published to Dockerhub.

RabbitHook provides endpoints to handle webhook events from services like Dockerhub or Github, and then publishes those events over AMQP.

Rabbit Builder is an agent for automated docker builds using RabbitHook events.

rhbuilder is a long running AMPQ client subscribed to events on the rabbithook.dockerhub topic. Any time we push an image to Dockerhub, an event is published and rhbuilder will then try to execute a build job for each event.


Adding jobs

To create a new job, you just need to place an executable script following some simple conventions:

base-path + / + dockerhub.owner + / + dockerhub.repository_name
  • base-path: By default is set to /usr/local/opt/rhbuilder
  • dockerhub.owner: Usually matches your Dockerhub username
  • dockerhub.repository_name: Matches your Dockerhub project's name

If you have a project on Dockerhub, say goliatoe/hello-rabbit. You need to create a directory named goliatone under /usr/local/opt/rhbuilder and place an executable script named hello-rabbit.

Note that in order to work, goliatoe/hello-rabbit has a webhook pointing to a running RabbitHook instance.

Daemon

This repository also provides a set of scripts to run rhbuilder using init.d or upstart. If you want to run this on a Raspberry Pi use the init.d scripts, else if possible use upstart.

For more information on how to use the boot scripts, refer to the readme file for the init.d or upstart

Example

Build script

There is a sample build script written in bash. This script is

Topic and sample payload

  • topic:
    • rabbithook.dockerhub

Sample Event Payload:

{
    "push_data": {
        "pushed_at": 1466026222,
        "images": [],
        "tag": "latest",
        "pusher": "goliatone"
    },
    "callback_url": "https://registry.hub.docker.com/u/goliatone/hello-rabbit/hook/4hac5445ga3f345ajeje31abc34ie06rip/",
    "repository": {
        "status": "Active",
        "description": "Hello rabbit!",
        "is_trusted": false,
        "full_description": "",
        "repo_url": "https://hub.docker.com/r/goliatone/hello-rabbit",
        "owner": "goliatone",
        "is_official": false,
        "is_private": false,
        "name": "hello-rabbit",
        "namespace": "goliatone",
        "star_count": 0,
        "comment_count": 0,
        "date_created": 1461793462,
        "repo_name": "goliatone/hello-rabbit"
    }
}

Install

You can use the installation scripts to install the daemon on your machine.

curl -sL https://raw.githubusercontent.com/goliatone/rabbithook-builder/master/conf/init.d/install | bash

Uninstall

curl -sL https://raw.githubusercontent.com/goliatone/rabbithook-builder/master/conf/init.d/uninstall | bash

rabbithook-builder's People

Contributors

goliatone avatar

Watchers

 avatar James Cloos 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.