2017 © Pedro Peláez
 

library satis-hook

image

shopen-group/satis-hook

  • Wednesday, June 27, 2018
  • by shopen-group
  • Repository
  • 1 Watchers
  • 2 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ShopenGroup/SatisHook

Build Status, (*1)

Simple app for rebuilding composer/satis via webhook. * No database required, (*2)

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., (*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();

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)., (*5)

Queue process

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)

The Versions