Download the PHP package amaxlab/git-web-hook without Composer
On this page you can find all versions of the php package amaxlab/git-web-hook. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package git-web-hook
Git web hook
Library for handle git web hooks from gitlab.com or github.com and run commands
Features
- Run commands by global get request
- Run commands by git repository push
- Run commands by some branch push
- Security check commit author (global, repository, branch)
- Security check param from $_GET request
- Send email author and mail recipients with the results of the execute command
Require
- php >= 5.3
- symfony/options-resolver ^2.3
- symfony/yaml ^2.3
- psr/log >= ~1.0
Install
or project
Usage
Old way:
Specify config in php file directly:
You can also specify some commands to execute them on hook call:
Preferred way:
Load config from yaml file
Configuration
Configuration can be unique for each branch, it is enough to pass the variable options of type array. You can pass them directly while creating hook or load through main config.yml file. You should use yaml files, due to configuration through php will be removed in future releases. See examples below.
Logging
Use loggers PSR-3 standard (Monolog)
Load repository configuration
If you have a lot of repositories you can place them in separate *.yml files and load all configuration from a directory:
Example of partial configuration file:
Security code checking configuration
Security code can be cofigured only on the root options.
Setup config:
and setup web hook on gitlab.com or github.com on
if security code not pass check the you see
in the log file
TODO
- Remove old way of configuration (through php file)
- Resolve passing config while loading config and remove unnessesary dependencies between classes hook/repository/branch/command
- Add more tests
- Refactor logging
License
This library is under the MIT license. See the complete license in here