2017 © Pedro Peláez
 

library gitlab-hook-receiver

Easy way to configure task after Gitlab `on push` hook.

image

szykra/gitlab-hook-receiver

Easy way to configure task after Gitlab `on push` hook.

  • Saturday, July 5, 2014
  • by szykra
  • Repository
  • 1 Watchers
  • 1 Stars
  • 239 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

GitLab Hook Receiver 0.1.1

Helper to GitLab hook services., (*1)

What it is?

It's a simple set of class to help create GitLab POST Hook. At this moment it supports Push Events., (*2)

How it works?

Imagine you have a project in VCS. Always when you push commits to the master branch your production server automatically pull all changes. Are you use composer? You can transfer special command through commit message to run composer install on production. See example., (*3)

Install

Install via composer or put it directly to composer.json file and run composer update., (*4)

require: {
    "szykra/gitlab-hook-receiver": "0.1.*"
}

Example

$directory = '/path/to/your/project/directory';

// Instance of Logger, in this case it's Monolog
$logger = new Logger("ON_PUSH", [new StreamHandler('hook.log')]);

// Create new Receiver and inject instance of Logger
$receiver = new GitLabRequestReceiver($logger);

// Set Gitlab POST data to Receiver Object
$receiver->prepareData(file_get_contents('php://input'));

// Add GitPullCommandListener to Receiver, argument is your git repository
// It automatically pull changes from current project branch
$receiver->addCommandListener(new GitPullCommandListener($directory));

// Add ComposerCommandListener to Receiver, argument is your project directory with composer.json file
// Now you can transfer composer action through commit message e.g. [composer:update]
$receiver->addCommandListener(new ComposerCommandListener($directory));

// Run all listeners
$receiver->run();

The Versions

05/07 2014

dev-master

9999999-dev

Easy way to configure task after Gitlab `on push` hook.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Szymon Krajewski

05/07 2014

dev-develop

dev-develop

Easy way to configure task after Gitlab `on push` hook.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Szymon Krajewski

05/07 2014

0.1.1

0.1.1.0

Easy way to configure task after Gitlab `on push` hook.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Szymon Krajewski

03/07 2014

0.1.0

0.1.0.0

Easy way to configure task after Gitlab `on push` hook.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Szymon Krajewski