Add new function to cover the svn project web hook and create a build.

This commit is contained in:
Sylvain Lévesque 2016-12-24 16:54:39 +07:00 committed by Dmitry Khomutov
parent 8113d302ed
commit d2ba729ded

View file

@ -400,6 +400,27 @@ class WebhookController extends Controller
return ['status' => 'ignored', 'message' => 'Unusable payload.'];
}
/**
* Called by POSTing to /webhook/svn/<project_id>?branch=<branch>&commit=<commit>
*
* @author Sylvain Lévesque <slevesque@gezere.com>
*
* @param string $projectId
*
* @return array
*/
public function svn($projectId)
{
$project = $this->fetchProject($projectId, 'svn');
$branch = $this->getParam('branch', $project->getBranch());
$commit = $this->getParam('commit');
$commitMessage = $this->getParam('message');
$committer = $this->getParam('committer');
return $this->createBuild($project, $commit, $branch, $committer, $commitMessage);
}
/**
* Wrapper for creating a new build.
*