fix symlink check and build dir
This commit is contained in:
parent
48ed635f63
commit
a4a443f255
|
@ -106,7 +106,7 @@ class Builder
|
|||
}
|
||||
|
||||
$this->log .= $prefix . $item . PHP_EOL;
|
||||
}, $message);
|
||||
}, $message);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -153,8 +153,8 @@ class Builder
|
|||
switch ($type)
|
||||
{
|
||||
case 'local':
|
||||
$this->buildPath = $this->ciDir . 'build/' . $buildId;
|
||||
|
||||
$this->buildPath = substr($this->buildPath, 0, -1);
|
||||
|
||||
if(!is_file($reference . '/phpci.yml'))
|
||||
{
|
||||
$this->logFailure('Project does not contain a phpci.yml file.');
|
||||
|
@ -163,7 +163,7 @@ class Builder
|
|||
|
||||
$yamlFile = file_get_contents($reference . '/phpci.yml');
|
||||
$this->config = $yamlParser->parse($yamlFile);
|
||||
|
||||
|
||||
if(array_key_exists('build_settings', $this->config)
|
||||
&& is_array($this->config['build_settings'])
|
||||
&& array_key_exists('prefer_symlink', $this->config['build_settings'])
|
||||
|
@ -175,20 +175,24 @@ class Builder
|
|||
}
|
||||
|
||||
$this->log(sprintf('Symlinking: %s to %s',$reference, $this->buildPath));
|
||||
symlink($reference, $this->buildPath);
|
||||
if ( !symlink($reference, $this->buildPath) )
|
||||
{
|
||||
$this->logFailure('Failed to symlink.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->executeCommand(sprintf("cp -Rf %s %s/", $reference, $this->buildPath));
|
||||
}
|
||||
|
||||
|
||||
$this->buildPath .= '/';
|
||||
break;
|
||||
|
||||
case 'github':
|
||||
case 'bitbucket':
|
||||
mkdir($this->buildPath, 0777, true);
|
||||
|
||||
|
||||
if(!empty($key))
|
||||
{
|
||||
// Do an SSH clone:
|
||||
|
@ -276,7 +280,7 @@ class Builder
|
|||
$this->success = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -295,7 +299,7 @@ class Builder
|
|||
$this->success = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->logFailure('PLUGIN STATUS: FAILED');
|
||||
continue;
|
||||
}
|
||||
|
@ -322,7 +326,7 @@ class Builder
|
|||
{
|
||||
$this->plugins[$plugin] = true;
|
||||
}
|
||||
|
||||
|
||||
$this->logSuccess('PLUGIN STATUS: SUCCESS!');
|
||||
}
|
||||
}
|
||||
|
|
0
PHPCI/build/.gitkeep
Normal file
0
PHPCI/build/.gitkeep
Normal file
Loading…
Reference in a new issue