Added ability to merge in-database project config over in-repository

config instead of only overwrite. This commit solve issues: #14, #70,
#106, #121.
This commit is contained in:
Dmitry Khomutov 2018-04-15 15:48:50 +07:00
commit 069026bc2d
No known key found for this signature in database
GPG key ID: EC19426474B37AAC
20 changed files with 277 additions and 130 deletions

View file

@ -59,10 +59,10 @@ class GitBuild extends Build
foreach ($branches as $branch) {
$success = $builder->executeCommand($cmd, $buildPath, $branch);
if (!$success) {
$builder->log('Fail merge branch origin/'.$branch, LogLevel::ERROR);
$builder->log('Fail merge branch origin/' . $branch, LogLevel::ERROR);
return false;
}
$builder->log('Merged branch origin/'.$branch, LogLevel::INFO);
$builder->log('Merged branch origin/' . $branch, LogLevel::INFO);
}
}
return true;
@ -75,10 +75,9 @@ class GitBuild extends Build
{
$cmd = 'cd .. && git clone --recursive ';
$depth = $builder->getConfig('clone_depth');
if (!is_null($depth)) {
$cmd .= ' --depth ' . intval($depth) . ' ';
$buildSettings = $builder->getConfig('build_settings');
if ($buildSettings && isset($buildSettings['clone_depth'])) {
$cmd .= ' --depth ' . intval($buildSettings['clone_depth']) . ' ';
}
$cmd .= ' -b "%s" "%s" "%s"';
@ -102,10 +101,9 @@ class GitBuild extends Build
// Do the git clone:
$cmd = 'cd .. && git clone --recursive ';
$depth = $builder->getConfig('clone_depth');
if (!is_null($depth)) {
$cmd .= ' --depth ' . intval($depth) . ' ';
$buildSettings = $builder->getConfig('build_settings');
if ($buildSettings && isset($buildSettings['clone_depth'])) {
$cmd .= ' --depth ' . intval($buildSettings['clone_depth']) . ' ';
}
$cmd .= ' -b "%s" "%s" "%s"';