Merging master to bring github branch into line.
This commit is contained in:
commit
be838c6765
|
@ -3,6 +3,7 @@
|
||||||
namespace PHPCI;
|
namespace PHPCI;
|
||||||
use PHPCI\Model\Build;
|
use PHPCI\Model\Build;
|
||||||
use b8\Store;
|
use b8\Store;
|
||||||
|
use Symfony\Component\Yaml\Parser as YamlParser;
|
||||||
|
|
||||||
class Builder
|
class Builder
|
||||||
{
|
{
|
||||||
|
@ -126,38 +127,81 @@ class Builder
|
||||||
$commitId = $this->build->getCommitId();
|
$commitId = $this->build->getCommitId();
|
||||||
$url = $this->build->getProject()->getGitUrl();
|
$url = $this->build->getProject()->getGitUrl();
|
||||||
$key = $this->build->getProject()->getGitKey();
|
$key = $this->build->getProject()->getGitKey();
|
||||||
|
$type = $this->build->getProject()->getType();
|
||||||
|
$reference = $this->build->getProject()->getReference();
|
||||||
|
$reference = substr($reference, -1) == '/' ? substr($reference, 0, -1) : $reference;
|
||||||
$buildId = 'project' . $this->build->getProject()->getId() . '-build' . $this->build->getId();
|
$buildId = 'project' . $this->build->getProject()->getId() . '-build' . $this->build->getId();
|
||||||
|
$yamlParser = new YamlParser();
|
||||||
|
|
||||||
$this->ciDir = realpath(dirname(__FILE__) . '/../') . '/';
|
$this->ciDir = realpath(dirname(__FILE__) . '/../') . '/';
|
||||||
$this->buildPath = $this->ciDir . 'build/' . $buildId . '/';
|
$this->buildPath = $this->ciDir . 'build/' . $buildId . '/';
|
||||||
|
|
||||||
mkdir($this->buildPath, 0777, true);
|
switch ($type)
|
||||||
|
{
|
||||||
|
case 'local':
|
||||||
|
$this->buildPath = $this->ciDir . 'build/' . $buildId;
|
||||||
|
|
||||||
|
if(!is_file($reference . '/phpci.yml'))
|
||||||
|
{
|
||||||
|
$this->logFailure('Project does not contain a phpci.yml file.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(!empty($key))
|
$yamlFile = file_get_contents($reference . '/phpci.yml');
|
||||||
{
|
$this->config = $yamlParser->parse($yamlFile);
|
||||||
// Do an SSH clone:
|
|
||||||
$keyFile = $this->ciDir . 'build/' . $buildId . '.key';
|
if(array_key_exists('build_settings', $this->config)
|
||||||
file_put_contents($keyFile, $key);
|
&& is_array($this->config['build_settings'])
|
||||||
chmod($keyFile, 0600);
|
&& array_key_exists('prefer_symlink', $this->config['build_settings'])
|
||||||
$this->executeCommand('ssh-agent ssh-add '.$keyFile.' && git clone -b ' .$this->build->getBranch() . ' ' .$url.' '.$this->buildPath.' && ssh-agent -k');
|
&& true === $this->config['build_settings']['prefer_symlink'])
|
||||||
unlink($keyFile);
|
{
|
||||||
}
|
if(is_link($this->buildPath) && is_file($this->buildPath))
|
||||||
else
|
{
|
||||||
{
|
unlink($this->buildPath);
|
||||||
// Do an HTTP clone:
|
}
|
||||||
$this->executeCommand('git clone -b ' .$this->build->getBranch() . ' ' .$url.' '.$this->buildPath);
|
|
||||||
}
|
$this->log(sprintf('Symlinking: %s to %s',$reference, $this->buildPath));
|
||||||
|
symlink($reference, $this->buildPath);
|
||||||
if(!is_file($this->buildPath . 'phpci.yml'))
|
}
|
||||||
{
|
else
|
||||||
$this->logFailure('Project does not contain a phpci.yml file.');
|
{
|
||||||
return false;
|
$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:
|
||||||
|
$keyFile = $this->ciDir . 'build/' . $buildId . '.key';
|
||||||
|
file_put_contents($keyFile, $key);
|
||||||
|
chmod($keyFile, 0600);
|
||||||
|
$this->executeCommand('ssh-agent ssh-add '.$keyFile.' && git clone -b ' .$this->build->getBranch() . ' ' .$url.' '.$this->buildPath.' && ssh-agent -k');
|
||||||
|
unlink($keyFile);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Do an HTTP clone:
|
||||||
|
$this->executeCommand('git clone -b ' .$this->build->getBranch() . ' ' .$url.' '.$this->buildPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!is_file($this->buildPath . 'phpci.yml'))
|
||||||
|
{
|
||||||
|
$this->logFailure('Project does not contain a phpci.yml file.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$yamlFile = file_get_contents($this->buildPath . 'phpci.yml');
|
||||||
|
$this->config = $yamlParser->parse($yamlFile);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->config = yaml_parse_file($this->buildPath . 'phpci.yml');
|
if(!isset($this->config['build_settings']['verbose']) || !$this->config['build_settings']['verbose'])
|
||||||
|
|
||||||
if(!isset($this->config['verbose']) || !$this->config['verbose'])
|
|
||||||
{
|
{
|
||||||
$this->verbose = false;
|
$this->verbose = false;
|
||||||
}
|
}
|
||||||
|
@ -166,9 +210,9 @@ class Builder
|
||||||
$this->verbose = true;
|
$this->verbose = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($this->config['ignore']))
|
if(isset($this->config['build_settings']['ignore']))
|
||||||
{
|
{
|
||||||
$this->ignore = $this->config['ignore'];
|
$this->ignore = $this->config['build_settings']['ignore'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->log('Set up build: ' . $this->buildPath);
|
$this->log('Set up build: ' . $this->buildPath);
|
||||||
|
@ -184,6 +228,12 @@ class Builder
|
||||||
|
|
||||||
protected function executePlugins($stage)
|
protected function executePlugins($stage)
|
||||||
{
|
{
|
||||||
|
// Ignore any stages for which we don't have plugins set:
|
||||||
|
if(!array_key_exists($stage, $this->config) || !is_array($this->config[$stage]))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach($this->config[$stage] as $plugin => $options)
|
foreach($this->config[$stage] as $plugin => $options)
|
||||||
{
|
{
|
||||||
$this->log('');
|
$this->log('');
|
||||||
|
|
|
@ -88,7 +88,11 @@ class ProjectController extends b8\Controller
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$id = '/tmp/' . md5(microtime(true));
|
$tempPath = sys_get_temp_dir() . '/';
|
||||||
|
$id = $tempPath . md5(microtime(true));
|
||||||
|
if (!is_dir($tempPath)) {
|
||||||
|
mkdir($tempPath);
|
||||||
|
}
|
||||||
shell_exec('ssh-keygen -q -t rsa -b 2048 -f '.$id.' -N "" -C "deploy@phpci"');
|
shell_exec('ssh-keygen -q -t rsa -b 2048 -f '.$id.' -N "" -C "deploy@phpci"');
|
||||||
|
|
||||||
$pub = file_get_contents($id . '.pub');
|
$pub = file_get_contents($id . '.pub');
|
||||||
|
@ -192,8 +196,8 @@ class ProjectController extends b8\Controller
|
||||||
|
|
||||||
$field = new Form\Element\Select('type');
|
$field = new Form\Element\Select('type');
|
||||||
$field->setRequired(true);
|
$field->setRequired(true);
|
||||||
$field->setPattern('^(github|bitbucket)');
|
$field->setPattern('^(github|bitbucket|local)');
|
||||||
$field->setOptions(array('choose' => 'Select repository type...', 'github' => 'Github', 'bitbucket' => 'Bitbucket'));
|
$field->setOptions(array('choose' => 'Select repository type...', 'github' => 'Github', 'bitbucket' => 'Bitbucket', 'local' => 'Local Path'));
|
||||||
$field->setLabel('Where is your project hosted?');
|
$field->setLabel('Where is your project hosted?');
|
||||||
$field->setClass('span4');
|
$field->setClass('span4');
|
||||||
$form->addField($field);
|
$form->addField($field);
|
||||||
|
@ -209,8 +213,8 @@ class ProjectController extends b8\Controller
|
||||||
|
|
||||||
$field = new Form\Element\Text('reference');
|
$field = new Form\Element\Text('reference');
|
||||||
$field->setRequired(true);
|
$field->setRequired(true);
|
||||||
$field->setPattern('[a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-]+');
|
$field->setPattern('[a-zA-Z0-9_\-\/]+');
|
||||||
$field->setLabel('Repository Name / URL:');
|
$field->setLabel('Repository Name / URL (Remote) or Path (Local)');
|
||||||
$field->setClass('span4');
|
$field->setClass('span4');
|
||||||
$form->addField($field);
|
$form->addField($field);
|
||||||
|
|
||||||
|
@ -222,7 +226,7 @@ class ProjectController extends b8\Controller
|
||||||
|
|
||||||
$field = new Form\Element\TextArea('key');
|
$field = new Form\Element\TextArea('key');
|
||||||
$field->setRequired(false);
|
$field->setRequired(false);
|
||||||
$field->setLabel('Private key to use to access repository (leave blank to use anonymous HTTP repository access)');
|
$field->setLabel('Private key to use to access repository (leave blank for local and/or anonymous remotes)');
|
||||||
$field->setClass('span7');
|
$field->setClass('span7');
|
||||||
$field->setRows(6);
|
$field->setRows(6);
|
||||||
$form->addField($field);
|
$form->addField($field);
|
||||||
|
|
|
@ -13,11 +13,11 @@ class PhpSpec implements \PHPCI\Plugin
|
||||||
|
|
||||||
public function execute()
|
public function execute()
|
||||||
{
|
{
|
||||||
$cwd = getcwd();
|
$curdir = getcwd();
|
||||||
|
chdir($this->phpci->buildPath);
|
||||||
$command = 'cd ' . $this->phpci->buildPath . ' && ';
|
$success = $this->phpci->executeCommand(PHPCI_BIN_DIR . 'phpspec');
|
||||||
$command .= PHPCI_BIN_DIR . 'phpspec';
|
chdir($curdir);
|
||||||
$command .= ' && cd ' . $cwd;
|
|
||||||
return $this->phpci->executeCommand($command);
|
return $success;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -17,6 +17,11 @@ class PhpUnit implements \PHPCI\Plugin
|
||||||
|
|
||||||
public function execute()
|
public function execute()
|
||||||
{
|
{
|
||||||
return $this->phpci->executeCommand(PHPCI_BIN_DIR . 'phpunit ' . $this->args . ' ' . $this->phpci->buildPath . $this->directory);
|
$curdir = getcwd();
|
||||||
|
chdir($this->phpci->buildPath);
|
||||||
|
$success = $this->phpci->executeCommand(PHPCI_BIN_DIR . 'phpunit ' . $this->args . ' ' . $this->phpci->buildPath . $this->directory);
|
||||||
|
chdir($curdir);
|
||||||
|
|
||||||
|
return $success;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
<div id="title">
|
<div id="title">
|
||||||
<h1 style="display: inline-block">Build #<?= $build->getId(); ?></h1>
|
<h1 style="display: inline-block">Build #<?php print $build->getId(); ?></h1>
|
||||||
<h3 style="margin-left: 40px; display: inline-block">Branch: <?= $build->getBranch(); ?> - <?= $build->getCommitId() == 'Manual' ? 'Manual Build' : 'Commit: ' . $build->getCommitId(); ?></h3>
|
<h3 style="margin-left: 40px; display: inline-block">Branch: <?php print $build->getBranch(); ?> - <?php print $build->getCommitId() == 'Manual' ? 'Manual Build' : 'Commit: ' . $build->getCommitId(); ?></h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -8,12 +8,12 @@
|
||||||
<div class="well" style="padding: 8px 0">
|
<div class="well" style="padding: 8px 0">
|
||||||
<ul class="nav nav-list">
|
<ul class="nav nav-list">
|
||||||
<li><a href="/"><i class="icon-home"></i> Dashboard</a></li>
|
<li><a href="/"><i class="icon-home"></i> Dashboard</a></li>
|
||||||
<li><a href="/project/view/<?= $build->getProject()->getId(); ?>"><i class="icon-folder-open"></i> <?= $build->getProject()->getTitle(); ?></a></li>
|
<li><a href="/project/view/<?php print $build->getProject()->getId(); ?>"><i class="icon-folder-open"></i> <?php print $build->getProject()->getTitle(); ?></a></li>
|
||||||
<li class="divider"></li>
|
<li class="divider"></li>
|
||||||
<li class="nav-header">Options</li>
|
<li class="nav-header">Options</li>
|
||||||
<li><a href="/build/rebuild/<?= $build->getId(); ?>"><i class="icon-cog"></i> Rebuild</a></li>
|
<li><a href="/build/rebuild/<?php print $build->getId(); ?>"><i class="icon-cog"></i> Rebuild</a></li>
|
||||||
<?php if($this->User()->getIsAdmin()): ?>
|
<?php if($this->User()->getIsAdmin()): ?>
|
||||||
<li><a href="javascript:confirmDelete('/build/delete/<?= $build->getId(); ?>')"><i class="icon-trash"></i> Delete Build</a></li>
|
<li><a href="javascript:confirmDelete('/build/delete/<?php print $build->getId(); ?>')"><i class="icon-trash"></i> Delete Build</a></li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="plugins">
|
<tbody id="plugins">
|
||||||
<?= $plugins; ?>
|
<?php print $plugins; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -68,13 +68,13 @@
|
||||||
<script>
|
<script>
|
||||||
setInterval(function()
|
setInterval(function()
|
||||||
{
|
{
|
||||||
$.getJSON('/build/data/<?= $build->getId(); ?>', updateBuildView);
|
$.getJSON('/build/data/<?php print $build->getId(); ?>', updateBuildView);
|
||||||
}, 10000);
|
}, 10000);
|
||||||
</script>
|
</script>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.initial = <?= $data; ?>;
|
window.initial = <?php print $data; ?>;
|
||||||
|
|
||||||
function updateBuildView(data)
|
function updateBuildView(data)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,21 +30,21 @@ switch($build->getStatus())
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<tr class="<?= $cls; ?>">
|
<tr class="<?php print $cls; ?>">
|
||||||
<td><a href="/build/view/<?= $build->getId(); ?>">#<?= str_pad($build->getId(), 6, '0', STR_PAD_LEFT); ?></a></td>
|
<td><a href="/build/view/<?php print $build->getId(); ?>">#<?php print str_pad($build->getId(), 6, '0', STR_PAD_LEFT); ?></a></td>
|
||||||
<td><a href="/project/view/<?= $build->getProjectId(); ?>"><?= $build->getProject()->getTitle(); ?></a></td>
|
<td><a href="/project/view/<?php print $build->getProjectId(); ?>"><?php print $build->getProject()->getTitle(); ?></a></td>
|
||||||
<td><a href="<?= $build->getCommitLink(); ?>"><?= $build->getCommitId(); ?></a></td>
|
<td><a href="<?php print $build->getCommitLink(); ?>"><?php print $build->getCommitId(); ?></a></td>
|
||||||
<td><a href="<?= $build->getBranchLink(); ?>"><?= $build->getBranch(); ?></a></td>
|
<td><a href="<?php print $build->getBranchLink(); ?>"><?php print $build->getBranch(); ?></a></td>
|
||||||
<td><?= $status; ?></td>
|
<td><?php print $status; ?></td>
|
||||||
<td>
|
<td>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<a class="btn" href="/build/view/<?= $build->getId(); ?>">View</a>
|
<a class="btn" href="/build/view/<?php print $build->getId(); ?>">View</a>
|
||||||
<?php if($this->User()->getIsAdmin()): ?>
|
<?php if($this->User()->getIsAdmin()): ?>
|
||||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
||||||
<span class="caret"></span>
|
<span class="caret"></span>
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li><a href="javascript:confirmDelete('/build/delete/<?= $build->getId(); ?>');">Delete Build</a></li>
|
<li><a href="javascript:confirmDelete('/build/delete/<?php print $build->getId(); ?>');">Delete Build</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<li class="nav-header">Projects</li>
|
<li class="nav-header">Projects</li>
|
||||||
|
|
||||||
<?php foreach($projects as $project): ?>
|
<?php foreach($projects as $project): ?>
|
||||||
<li><a href="/project/view/<?= $project->getId(); ?>"><i class="icon-folder-open"></i> <?= $project->getTitle(); ?></a></li>
|
<li><a href="/project/view/<?php print $project->getId(); ?>"><i class="icon-folder-open"></i> <?php print $project->getTitle(); ?></a></li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="latest-builds">
|
<tbody id="latest-builds">
|
||||||
<?= $builds; ?>
|
<?php print $builds; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -91,7 +91,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="content" class="container">
|
<div id="content" class="container">
|
||||||
<?= $content; ?>
|
<?php print $content; ?>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
@ -43,7 +42,7 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row" style="margin-top: 10%; text-align: center">
|
<div class="row" style="margin-top: 10%; text-align: center">
|
||||||
<div class="" id="login-box">
|
<div class="" id="login-box">
|
||||||
<?= $form; ?>
|
<?php print $form; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a id="logo" href="http://www.block8.co.uk/"><img src="http://cms.block8.co.uk/assets/img/small-logo-trans-white.png"></a>
|
<a id="logo" href="http://www.block8.co.uk/"><img src="http://cms.block8.co.uk/assets/img/small-logo-trans-white.png"></a>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div id="title">
|
<div id="title">
|
||||||
<h1>Project: <?= $project->getTitle(); ?></h1>
|
<h1>Project: <?php print $project->getTitle(); ?></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -7,14 +7,14 @@
|
||||||
<div class="well" style="padding: 8px 0">
|
<div class="well" style="padding: 8px 0">
|
||||||
<ul class="nav nav-list">
|
<ul class="nav nav-list">
|
||||||
<li><a href="/"><i class="icon-home"></i> Dashboard</a></li>
|
<li><a href="/"><i class="icon-home"></i> Dashboard</a></li>
|
||||||
<li><a href="/project/view/<?= $project->getId(); ?>"><i class="icon-folder-open"></i> <?= $project->getTitle(); ?></a></li>
|
<li><a href="/project/view/<?php print $project->getId(); ?>"><i class="icon-folder-open"></i> <?php print $project->getTitle(); ?></a></li>
|
||||||
<li class="divider"></li>
|
<li class="divider"></li>
|
||||||
<li class="nav-header">Options</li>
|
<li class="nav-header">Options</li>
|
||||||
<li><a href="/project/build/<?= $project->getId(); ?>"><i class="icon-cog"></i> Build Now</a></li>
|
<li><a href="/project/build/<?php print $project->getId(); ?>"><i class="icon-cog"></i> Build Now</a></li>
|
||||||
|
|
||||||
<?php if($this->User()->getIsAdmin()): ?>
|
<?php if($this->User()->getIsAdmin()): ?>
|
||||||
<li><a href="/project/edit/<?= $project->getId(); ?>"><i class="icon-edit"></i> Edit Project</a></li>
|
<li><a href="/project/edit/<?php print $project->getId(); ?>"><i class="icon-edit"></i> Edit Project</a></li>
|
||||||
<li><a href="javascript:confirmDelete('/project/delete/<?= $project->getId(); ?>')"><i class="icon-trash"></i> Delete Project</a></li>
|
<li><a href="javascript:confirmDelete('/project/delete/<?php print $project->getId(); ?>')"><i class="icon-trash"></i> Delete Project</a></li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="latest-builds">
|
<tbody id="latest-builds">
|
||||||
<?= $builds; ?>
|
<?php print $builds; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@
|
||||||
<script>
|
<script>
|
||||||
setInterval(function()
|
setInterval(function()
|
||||||
{
|
{
|
||||||
$('#latest-builds').load('/project/builds/<?= $project->getId(); ?>');
|
$('#latest-builds').load('/project/builds/<?php print $project->getId(); ?>');
|
||||||
}, 10000);
|
}, 10000);
|
||||||
</script>
|
</script>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
|
@ -1,5 +1,5 @@
|
||||||
<div id="title">
|
<div id="title">
|
||||||
<h1><?= $type == 'add' ? 'Add Project' : 'Edit Project' ?></h1>
|
<h1><?php print $type == 'add' ? 'Add Project' : 'Edit Project' ?></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
<?php if(!is_null($key)): ?>
|
<?php if(!is_null($key)): ?>
|
||||||
<p>To make it easier to get started, we've generated a public / private key pair for you to use for this project. To use it, just add the following public key to the "deploy keys" section of your repository settings on Github / Bitbucket.</p>
|
<p>To make it easier to get started, we've generated a public / private key pair for you to use for this project. To use it, just add the following public key to the "deploy keys" section of your repository settings on Github / Bitbucket.</p>
|
||||||
|
|
||||||
<textarea style="width: 90%; height: 150px;"><?= $key ?></textarea>
|
<textarea style="width: 90%; height: 150px;"><?php print $key ?></textarea>
|
||||||
<?php elseif($type == 'add'): ?>
|
<?php elseif($type == 'add'): ?>
|
||||||
<p>Fill in the form to the right to add your new project.</p>
|
<p>Fill in the form to the right to add your new project.</p>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="span8">
|
<div class="span8">
|
||||||
<?= $form; ?>
|
<?php print $form; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -40,19 +40,19 @@
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<tr class="<?= $cls; ?>">
|
<tr class="<?php print $cls; ?>">
|
||||||
<td><a href="/user/edit/<?= $user->getId(); ?>"><?= $user->getEmail(); ?></a></td>
|
<td><a href="/user/edit/<?php print $user->getId(); ?>"><?php print $user->getEmail(); ?></a></td>
|
||||||
<td><?= $user->getName(); ?></td>
|
<td><?php print $user->getName(); ?></td>
|
||||||
<td><?= $status; ?></td>
|
<td><?php print $status; ?></td>
|
||||||
<td>
|
<td>
|
||||||
<?php if($this->User()->getIsAdmin()): ?>
|
<?php if($this->User()->getIsAdmin()): ?>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<a class="btn" href="/user/edit/<?= $user->getId(); ?>">Edit</a>
|
<a class="btn" href="/user/edit/<?php print $user->getId(); ?>">Edit</a>
|
||||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
||||||
<span class="caret"></span>
|
<span class="caret"></span>
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li><a href="javascript:confirmDelete('/user/delete/<?= $user->getId(); ?>');">Delete User</a></li>
|
<li><a href="javascript:confirmDelete('/user/delete/<?php print $user->getId(); ?>');">Delete User</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div id="title">
|
<div id="title">
|
||||||
<h1><?= $type == 'add' ? 'Add User' : 'Edit ' . $user->getName() ?></h1>
|
<h1><?php print $type == 'add' ? 'Add User' : 'Edit ' . $user->getName() ?></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -13,6 +13,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="span8">
|
<div class="span8">
|
||||||
<?= $form; ?>
|
<?php print $form; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
14
README.md
14
README.md
|
@ -6,7 +6,7 @@ PHPCI is a free and open source continuous integration tool specifically designe
|
||||||
_**Please be aware that this is a brand new project, in an alpha state, so there will be bugs and missing features.**_
|
_**Please be aware that this is a brand new project, in an alpha state, so there will be bugs and missing features.**_
|
||||||
|
|
||||||
##What it does:
|
##What it does:
|
||||||
* Clones your repository from Github or Bitbucket (support for standard Git repositories coming soon.)
|
* Clones your project from Github, Bitbucket or a local path (support for standard remote Git repositories coming soon.)
|
||||||
* Allows you to set up and tear down test databases.
|
* Allows you to set up and tear down test databases.
|
||||||
* Installs your project's Composer dependencies.
|
* Installs your project's Composer dependencies.
|
||||||
* Runs through any combination of the following plugins:
|
* Runs through any combination of the following plugins:
|
||||||
|
@ -14,6 +14,7 @@ _**Please be aware that this is a brand new project, in an alpha state, so there
|
||||||
* PHP Mess Detector
|
* PHP Mess Detector
|
||||||
* PHP Copy/Paste Detector
|
* PHP Copy/Paste Detector
|
||||||
* PHP Code Sniffer
|
* PHP Code Sniffer
|
||||||
|
* PHP Spec
|
||||||
* You can mark directories for the plugins to ignore.
|
* You can mark directories for the plugins to ignore.
|
||||||
* You can mark certain plugins as being allowed to fail (but still run.)
|
* You can mark certain plugins as being allowed to fail (but still run.)
|
||||||
|
|
||||||
|
@ -67,7 +68,12 @@ Obviously, make sure you change the `/path/to/phpci` to the directory in which y
|
||||||
##Adding support for PHPCI to your projects:
|
##Adding support for PHPCI to your projects:
|
||||||
Similar to Travis CI, to support PHPCI in your project, you simply need to add a `phpci.yml` file to the root of your repository. The file should look something like this:
|
Similar to Travis CI, to support PHPCI in your project, you simply need to add a `phpci.yml` file to the root of your repository. The file should look something like this:
|
||||||
|
|
||||||
setup:
|
build_settings:
|
||||||
|
ignore:
|
||||||
|
- "vendor"
|
||||||
|
- "tests"
|
||||||
|
|
||||||
|
setup:
|
||||||
mysql:
|
mysql:
|
||||||
- "DROP DATABASE IF EXISTS test;"
|
- "DROP DATABASE IF EXISTS test;"
|
||||||
- "CREATE DATABASE test;"
|
- "CREATE DATABASE test;"
|
||||||
|
@ -75,10 +81,6 @@ Similar to Travis CI, to support PHPCI in your project, you simply need to add a
|
||||||
composer:
|
composer:
|
||||||
action: "install"
|
action: "install"
|
||||||
|
|
||||||
ignore:
|
|
||||||
- "vendor"
|
|
||||||
- "tests"
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
php_unit:
|
php_unit:
|
||||||
directory: "tests/"
|
directory: "tests/"
|
||||||
|
|
|
@ -30,6 +30,6 @@
|
||||||
"squizlabs/php_codesniffer": "1.*",
|
"squizlabs/php_codesniffer": "1.*",
|
||||||
"ircmaxell/password-compat": "1.x",
|
"ircmaxell/password-compat": "1.x",
|
||||||
"phpspec/phpspec": "2.*",
|
"phpspec/phpspec": "2.*",
|
||||||
"ext-yaml": "*"
|
"symfony/yaml": "2.2.x-dev"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue