richardpayment/satis-hook
Composer 安装命令:
composer require richardpayment/satis-hook
包简介
README 文档
README
Simple app for rebuilding composer/satis via webhook.
- No database required
Install
Install composer package
composer require shopen-group/satis-hook dev-develop
Create config
# config.yaml secret: enabled: true # secret token is enabled location: param # location of "secret" parameter (param|header) value: veslo # secret value name: key # secret parameter name satis: php: /usr/bin/php bin: ../satis/bin/satis config: ../satis.json output: ../web
Create entrypoint
Our entrypoint will be hook.php which is publicly accessible via HTTP.
ApplicationFactory::createApplication has three parameters. You can customise the first two of them.
- path to config.yaml
- path to writable TEMP folder (for storing requests)
<?php declare(strict_types=1); require_once __DIR__ . '/vendor/autoload.php'; use ShopenGroup\SatisHook\ApplicationFactory; $application = ApplicationFactory::createApplication(__DIR__ . '/config.yaml', __DIR__ . '/temp', __DIR__ . '/logs', $argc); $application->run();
Usage
Webhook
The app is accepting GET and POST requests through https://127.0.0.1/hook.php.
There is an optional parameter "build-all". If the "build-all" parameter is present in request you can build all packages not necessarily just one particular package (http:/127.0.0.1/hook.php?repository=package/name).
Queue process
There is a second "layer" of application - queue processing. To start processing accepted requests you have to run command below via CLI.
php hook.php satis-hook:build
We use supervisord to keep queue processing up.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-08-03