Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.
/ webhook-commander Public archive

Allows to trigger commands on github webhook calls

License

Notifications You must be signed in to change notification settings

gbprod/webhook-commander

Repository files navigation

Webhook Commander

Under development ! :)

Build Status codecov Scrutinizer Code Quality Dependency Status

This application allows to launch commands triggered by github webhooks. I use it for continous delivery.

Installation

git clone git@github.com:gbprod/webhook-commander.git
cd webhook-commander
make deploy

This will ask you a secret, generate a random one (with http://www.sha1.fr/ for example).

Setup an web access to this application (web/app.php). Example using Apache2 virtualhost:

<VirtualHost *:80>
        ServerName webhook.my-url.com
        DocumentRoot /var/www/html/webhook-commander/web
        <Directory /var/www/html/webhook-commander/web>
                AllowOverride All
                Order allow,deny
                Allow from all
                <IfModule mod_rewrite.c>
                        Options -MultiViews
                        RewriteEngine On
                        RewriteCond %{REQUEST_FILENAME} !-f
                        RewriteRule ^(.*)$ app.php [QSA,L]
                </IfModule>
        </Directory>
</VirtualHost>

Create a webhook for your Github project. Go to your project settings -> Webhooks and services -> Add webhook

Fill the form with something like:

Configure your triggers in app/config/parameter.yml:

parameters:
    secret: YourSecretWithGithub
    triggers:
        app1:                          # Just a reminder name
            repository: foo/bar        # The repository (only webhooks triggered by this repository will run command)
            branch: master             # The branch (only webhooks triggered by this branch will run command)
            path: /var/www/html/my_app # Path where the command should be executed
            command: make deploy       # The command to run
        app2:
            repository: gbprod/cowboys
            branch: master
            path: /var/www/html/cowboys
            command: git pull && make deploy

Requirements

  • PHP 5.5+

Licence

This package is under MIT Licence. Feel free to contribute !

About

Allows to trigger commands on github webhook calls

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published