Fixes for Gogs build and webhook. Issue #13

This commit is contained in:
Dmitry Khomutov 2017-02-07 19:50:09 +07:00
commit 9e478fd821
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9
12 changed files with 54 additions and 97 deletions

View file

@ -276,9 +276,9 @@ class ProjectController extends PHPCensor\Controller
$values['key'] = $values['ssh_private_key'];
$values['pubkey'] = $values['ssh_public_key'];
if ($values['type'] == "gitlab") {
$accessInfo = $project->getAccessInformation();
$reference = $accessInfo["user"].'@'.$accessInfo["domain"].':' . $accessInfo["port"] . '/' . ltrim($project->getReference(), '/') . ".git";
if ($values['type'] == 'gitlab') {
$accessInfo = $project->getAccessInformation();
$reference = $accessInfo["user"] . '@' . $accessInfo["domain"] . ':' . $accessInfo["port"] . '/' . ltrim($project->getReference(), '/') . ".git";
$values['reference'] = $reference;
}
@ -332,17 +332,18 @@ class ProjectController extends PHPCensor\Controller
$options = [
'choose' => Lang::get('select_repository_type'),
'github' => Lang::get('github'),
'bitbucket' => Lang::get('bitbucket'),
'gitlab' => Lang::get('gitlab'),
'remote' => Lang::get('remote'),
'github' => 'GitHub',
'bitbucket' => 'Bitbucket',
'gitlab' => 'GitLab',
'gogs' => 'Gogs',
'remote' => 'Git',
'local' => Lang::get('local'),
'hg' => Lang::get('hg'),
'svn' => Lang::get('svn'),
'hg' => 'Mercurial (Hg)',
'svn' => 'SVN',
];
$field = Form\Element\Select::create('type', Lang::get('where_hosted'), true);
$field->setPattern('^(github|bitbucket|gitlab|remote|local|hg|svn)');
$field->setPattern('^(github|bitbucket|gitlab|gogs|remote|local|hg|svn)');
$field->setOptions($options);
$field->setClass('form-control')->setContainerClass('form-group');
$form->addField($field);