Skip to content

Commit 43736f3

Browse files
authored
Add gitlab service (#2)
* add gitlab support with GitlabService.php in src/GitHook/Payload/Services * update the readme
1 parent 195a491 commit 43736f3

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Custom configuration can be made within the `config/git-hook.php` file:
4949
| remote | `origin` | | Your remote branch name |
5050
| git_path | `/usr/bin/git` | | Where is the git binary located |
5151
| logfile | `git-hook` | | Name of the logfile. It will be stored under storage/logs |
52-
| service | `github` | `github`, `gitbucket` | Define your remote git service. This is required to identify the payload |
52+
| service | `github` | `github`, `gitbucket`, `gitlab` | Define your remote git service. This is required to identify the payload |
5353
| url | `git-hook` | | Define the deployment url. Keep in mind, that the given parameter will be added to your app.url |
5454
| before_pull | `[]` | `['down', ['cmd', ['arg1' => 1]]]` | If you have any commands that have to be called before a pull event, specify them here |
5555
| after_pull | `[]` | `['cmd', ['cmd1', ['arg1' => 1]], 'up']` | If you have any commands that have to be called after a pull event, specify them here |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
/*
4+
* File: GitlabService.php
5+
* Category: -
6+
* Author: AA
7+
* Created: 08.11.17 3:20
8+
* Updated: -
9+
*/
10+
11+
12+
namespace Webklex\GitHook\Payload\Services;
13+
14+
use Webklex\GitHook\Payload\Payload;
15+
16+
class GitlabService extends Payload {
17+
18+
protected $map = [
19+
'commits' => [[
20+
'id' => null,
21+
'timestamp' => null,
22+
'message' => null,
23+
'url' => null,
24+
'author' => [
25+
'name' => null,
26+
'email' => null,
27+
],
28+
]],
29+
'repository' => [
30+
'name' => null,
31+
'description' => null,
32+
'url' => null,
33+
'homepage' => null,
34+
],
35+
'ref' => null,
36+
'user_name' => null,
37+
'before' => null,
38+
'after' => null,
39+
];
40+
41+
protected $casts = [];
42+
43+
}

0 commit comments

Comments
 (0)