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

@ -636,6 +636,14 @@ class WebhookController extends Controller
}
}
// Check if this branch is to be built.
if ($project->getDefaultBranchOnly() && ($branch !== $project->getBranch())) {
return [
'status' => 'ignored',
'message' => 'The branch is not a branch by default. Build is allowed only for the branch by default.'
];
}
$environments = $project->getEnvironmentsObjects();
if ($environments['count']) {
$created_builds = [];