optional symlink defaulting to cp
This commit is contained in:
parent
0bf1d9a813
commit
177a524475
|
@ -133,15 +133,37 @@ class Builder
|
||||||
case 'local':
|
case 'local':
|
||||||
$reference = $this->build->getProject()->getReference();
|
$reference = $this->build->getProject()->getReference();
|
||||||
$this->buildPath = $this->ciDir . 'build/' . $buildId;
|
$this->buildPath = $this->ciDir . 'build/' . $buildId;
|
||||||
|
|
||||||
// don't want no slash on the end
|
// don't want no slash on the end
|
||||||
if(substr($reference, -1) == '/') {
|
if(substr($reference, -1) == '/') {
|
||||||
$reference = substr($reference, 0, -1)
|
$reference = substr($reference, 0, -1);
|
||||||
}
|
}
|
||||||
if(is_link($this->buildPath) && is_file($this->buildPath)) {
|
|
||||||
|
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)) {
|
||||||
|
unlink($this->buildPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
symlink($reference, $this->buildPath);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
symlink($reference, $this->buildPath);
|
$this->executeCommand(
|
||||||
|
sprintf("cp -Rf %s %s/", $reference, $this->buildPath)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
$this->buildPath .= '/';
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
mkdir($this->buildPath, 0777, true);
|
mkdir($this->buildPath, 0777, true);
|
||||||
|
|
|
@ -16,79 +16,61 @@ class ProjectBase extends Model
|
||||||
protected $_tableName = 'project';
|
protected $_tableName = 'project';
|
||||||
protected $_modelName = 'Project';
|
protected $_modelName = 'Project';
|
||||||
protected $_data = array(
|
protected $_data = array(
|
||||||
'id' => null,
|
'id' => null,
|
||||||
'title' => null,
|
'title' => null,
|
||||||
'reference' => null,
|
'reference' => null,
|
||||||
'git_key' => null,
|
'git_key' => null,
|
||||||
'type' => null,
|
'type' => null,
|
||||||
);
|
);
|
||||||
protected $_getters = array(
|
protected $_getters = array(
|
||||||
'id' => 'getId',
|
'id' => 'getId',
|
||||||
'title' => 'getTitle',
|
'title' => 'getTitle',
|
||||||
'reference' => 'getReference',
|
'reference' => 'getReference',
|
||||||
'git_key' => 'getGitKey',
|
'git_key' => 'getGitKey',
|
||||||
'type' => 'getType',
|
'type' => 'getType',
|
||||||
|
);
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
protected $_setters = array(
|
protected $_setters = array(
|
||||||
'id' => 'setId',
|
'id' => 'setId',
|
||||||
'title' => 'setTitle',
|
'title' => 'setTitle',
|
||||||
'reference' => 'setReference',
|
'reference' => 'setReference',
|
||||||
'git_key' => 'setGitKey',
|
'git_key' => 'setGitKey',
|
||||||
'type' => 'setType',
|
'type' => 'setType',
|
||||||
|
);
|
||||||
|
|
||||||
);
|
|
||||||
public $columns = array(
|
public $columns = array(
|
||||||
'id' => array(
|
'id' => array(
|
||||||
'type' => 'int',
|
'type' => 'int',
|
||||||
'length' => '11',
|
'length' => '11',
|
||||||
|
|
||||||
'primary_key' => true,
|
'primary_key' => true,
|
||||||
'auto_increment' => true,
|
'auto_increment' => true,
|
||||||
|
|
||||||
),
|
),
|
||||||
'title' => array(
|
'title' => array(
|
||||||
'type' => 'varchar',
|
'type' => 'varchar',
|
||||||
'length' => '250',
|
'length' => '250',
|
||||||
|
),
|
||||||
|
'reference' => array(
|
||||||
|
'type' => 'varchar',
|
||||||
|
'length' => '250',
|
||||||
|
),
|
||||||
|
'git_key' => array(
|
||||||
|
'type' => 'text',
|
||||||
|
'length' => '',
|
||||||
|
),
|
||||||
|
'type' => array(
|
||||||
|
'type' => 'varchar',
|
||||||
|
'length' => '50',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
),
|
|
||||||
'reference' => array(
|
|
||||||
'type' => 'varchar',
|
|
||||||
'length' => '250',
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
),
|
|
||||||
'git_key' => array(
|
|
||||||
'type' => 'text',
|
|
||||||
'length' => '',
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
),
|
|
||||||
'type' => array(
|
|
||||||
'type' => 'varchar',
|
|
||||||
'length' => '50',
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
),
|
|
||||||
);
|
|
||||||
public $indexes = array(
|
public $indexes = array(
|
||||||
'PRIMARY' => array('unique' => true, 'columns' => 'id'),
|
'PRIMARY' => array('unique' => true, 'columns' => 'id'),
|
||||||
);
|
);
|
||||||
|
|
||||||
public $foreignKeys = array(
|
public $foreignKeys = array(
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue