Added support for gitlab merge requests
Added function to verify if a gitlab merge request is sent. If yes, then will create a build for the source branch of the request. Closes #699
This commit is contained in:
parent
768a8a180c
commit
e4bf5ee27d
|
@ -256,6 +256,21 @@ class WebhookController extends \PHPCI\Controller
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|
||||||
|
// build on merge request events
|
||||||
|
if (isset($payload['object_kind']) && $payload['object_kind'] == 'merge_request') {
|
||||||
|
$attributes = $payload['object_attributes'];
|
||||||
|
if ( $attributes['state'] == 'opened' || $attributes['state'] == 'reopened') {
|
||||||
|
|
||||||
|
$branch = $attributes['source_branch'];
|
||||||
|
$commit = $attributes['last_commit'];
|
||||||
|
$committer = $commit['author']['email'];
|
||||||
|
|
||||||
|
$this->createBuild($project, $commit['id'], $branch, $committer, $commit['message'] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// build on push events
|
||||||
if (isset($payload['commits']) && is_array($payload['commits'])) {
|
if (isset($payload['commits']) && is_array($payload['commits'])) {
|
||||||
// If we have a list of commits, then add them all as builds to be tested:
|
// If we have a list of commits, then add them all as builds to be tested:
|
||||||
|
|
||||||
|
|
8
composer.lock
generated
8
composer.lock
generated
|
@ -172,12 +172,12 @@
|
||||||
"version": "v1.1.1",
|
"version": "v1.1.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/fabpot/Pimple.git",
|
"url": "https://github.com/silexphp/Pimple.git",
|
||||||
"reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d"
|
"reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/fabpot/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d",
|
"url": "https://api.github.com/repos/silexphp/Pimple/zipball/2019c145fe393923f3441b23f29bbdfaa5c58c4d",
|
||||||
"reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d",
|
"reference": "2019c145fe393923f3441b23f29bbdfaa5c58c4d",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
|
@ -202,9 +202,7 @@
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Fabien Potencier",
|
"name": "Fabien Potencier",
|
||||||
"email": "fabien@symfony.com",
|
"email": "fabien@symfony.com"
|
||||||
"homepage": "http://fabien.potencier.org",
|
|
||||||
"role": "Lead Developer"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Pimple is a simple Dependency Injection Container for PHP 5.3",
|
"description": "Pimple is a simple Dependency Injection Container for PHP 5.3",
|
||||||
|
|
Loading…
Reference in a new issue