Wallogit.com
2017 © Pedro Peláez
Simple app for rebuilding composer/satis via webhook. * No database required, (*2)
composer require shopen-group/satis-hook dev-develop
# 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
Our entrypoint will be hook.php which is publicly accessible via HTTP., (*3)
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), (*4)
<?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();
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)., (*5)
There is a second "layer" of application - queue processing. To start processing accepted requests you have to run command below via CLI., (*6)
php hook.php satis-hook:build
We use supervisord to keep queue processing up., (*7)