optional symlink defaulting to cp
This commit is contained in:
parent
0bf1d9a813
commit
177a524475
|
@ -133,15 +133,37 @@ class Builder
|
|||
case 'local':
|
||||
$reference = $this->build->getProject()->getReference();
|
||||
$this->buildPath = $this->ciDir . 'build/' . $buildId;
|
||||
|
||||
// don't want no slash on the end
|
||||
if(substr($reference, -1) == '/') {
|
||||
$reference = substr($reference, 0, -1)
|
||||
$reference = substr($reference, 0, -1);
|
||||
}
|
||||
|
||||
if(!is_file($reference . '/phpci.yml'))
|
||||
{
|
||||
$this->logFailure('Project does not contain a phpci.yml file.');
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->config = yaml_parse_file($reference . '/phpci.yml');
|
||||
|
||||
if ( array_key_exists('prebuild', $this->config)
|
||||
&& is_array($this->config['prebuild'])
|
||||
&& array_key_exists('preferSymlink', $this->config['prebuild'])
|
||||
&& true === $this->config['prebuild']['preferSymlink'] ) {
|
||||
|
||||
if(is_link($this->buildPath) && is_file($this->buildPath)) {
|
||||
} else {
|
||||
unlink($this->buildPath);
|
||||
}
|
||||
|
||||
symlink($reference, $this->buildPath);
|
||||
}
|
||||
$this->buildPath .= '/';
|
||||
} else {
|
||||
$this->executeCommand(
|
||||
sprintf("cp -Rf %s %s/", $reference, $this->buildPath)
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
mkdir($this->buildPath, 0777, true);
|
||||
|
|
|
@ -28,8 +28,6 @@ class ProjectBase extends Model
|
|||
'reference' => 'getReference',
|
||||
'git_key' => 'getGitKey',
|
||||
'type' => 'getType',
|
||||
|
||||
|
||||
);
|
||||
|
||||
protected $_setters = array(
|
||||
|
@ -38,8 +36,8 @@ class ProjectBase extends Model
|
|||
'reference' => 'setReference',
|
||||
'git_key' => 'setGitKey',
|
||||
'type' => 'setType',
|
||||
|
||||
);
|
||||
|
||||
public $columns = array(
|
||||
'id' => array(
|
||||
'type' => 'int',
|
||||
|
@ -52,44 +50,28 @@ class ProjectBase extends Model
|
|||
'title' => array(
|
||||
'type' => 'varchar',
|
||||
'length' => '250',
|
||||
|
||||
|
||||
|
||||
|
||||
),
|
||||
'reference' => array(
|
||||
'type' => 'varchar',
|
||||
'length' => '250',
|
||||
|
||||
|
||||
|
||||
|
||||
),
|
||||
'git_key' => array(
|
||||
'type' => 'text',
|
||||
'length' => '',
|
||||
|
||||
|
||||
|
||||
|
||||
),
|
||||
'type' => array(
|
||||
'type' => 'varchar',
|
||||
'length' => '50',
|
||||
|
||||
|
||||
|
||||
|
||||
),
|
||||
);
|
||||
|
||||
public $indexes = array(
|
||||
'PRIMARY' => array('unique' => true, 'columns' => 'id'),
|
||||
);
|
||||
|
||||
public $foreignKeys = array(
|
||||
);
|
||||
|
||||
|
||||
|
||||
public function getId()
|
||||
{
|
||||
$rtn = $this->_data['id'];
|
||||
|
|
Loading…
Reference in a new issue