Added a checkbox to build only the default branch specified in the project.

This commit is contained in:
Pat Suwalski 2017-09-13 21:21:49 +07:00 committed by Dmitry Khomutov
commit bbbd9b3cf2
7 changed files with 102 additions and 12 deletions

View file

@ -54,6 +54,7 @@ class ProjectService
$project->setType($type);
$project->setReference($reference);
$project->setAllowPublicStatus(0);
$project->setDefaultBranchOnly(0);
// Handle extra project options:
if (array_key_exists('ssh_private_key', $options)) {
@ -80,6 +81,10 @@ class ProjectService
$project->setBranch($options['branch']);
}
if (array_key_exists('default_branch_only', $options)) {
$project->setDefaultBranchOnly((int)$options['default_branch_only']);
}
if (array_key_exists('group', $options)) {
$project->setGroup($options['group']);
}