Giter Club home page Giter Club logo

gitlab-webhook-branch-deployer's Introduction

gitlab-webhook-branch-deployer

Clones and maintains directories with the latest contents of a branch.

Usage

$ ./gitlab-webhook.py --port 8000 [email protected]:vinodc/gitlab-webhook-branch-deployer.git /home/vinod/gwbd

This will run the process and listen on port 8000 for POST requests from Gitlab that correspond to the repository vinodc/gitlab-webhook-branch-deployer. When it receives a request, it will clone the branches that were indicated as having been updated to the directory /home/vinod/gwbd.

It will ignore any branch with a '/' in it's name. This is intentional, to allow for feature branches or similar that will not be cloned.

For help: $ ./gitlab-webhook.py -h

Deployment

I recommend using http://supervisord.org/ or similar to run the script. For the sake of completion, here are the contents of my supervisord conf.d file:

/etc/supervisor/conf.d/gitlab-webhook.conf

command=/usr/bin/env python /opt/githooks/deployer/gitlab-webhook.py --port 8001 [email protected]:vinodc/gitlab-webhook-branch-deployer.git /opt/githooks/gwbd
directory=/opt/githooks/deployer
user=deployer
numprocs=1
autostart=true
process_name=%(program_name)s-%(process_num)02d
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/%(program_name)s-%(process_num)s-stdout.log

Acknowledgements

Inspired by https://github.com/shawn-sterling/gitlab-webhook-receiver.

License

GPLv2

gitlab-webhook-branch-deployer's People

Contributors

vinodc 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.