Added database-based yml build config

This commit is contained in:
Dmitry Khomutov 2014-03-15 12:18:12 +07:00
commit 60bf262ee7
5 changed files with 88 additions and 32 deletions

View file

@ -34,7 +34,6 @@ class RemoteGitBuild extends Build
*/
public function createWorkingCopy(Builder $builder, $buildPath)
{
$yamlParser = new YamlParser();
$key = trim($this->getProject()->getGitKey());
if (!empty($key)) {
@ -48,13 +47,18 @@ class RemoteGitBuild extends Build
return false;
}
if (!is_file($buildPath . 'phpci.yml')) {
$builder->logFailure('Project does not contain a phpci.yml file.');
return false;
}
$build_config = $this->getProject()->getBuildConfig();
if (!$build_config)
{
if (!is_file($buildPath . '/phpci.yml')) {
$builder->logFailure('Project does not contain a phpci.yml file.');
return false;
}
$build_config = file_get_contents($buildPath . '/phpci.yml');
}
$yamlFile = file_get_contents($buildPath . 'phpci.yml');
$builder->setConfigArray($yamlParser->parse($yamlFile));
$yamlParser = new YamlParser();
$builder->setConfigArray($yamlParser->parse($build_config));
return true;
}