Merge branch 'master' of github.com:Block8/PHPCI

This commit is contained in:
Dmitry Khomutov 2014-04-10 23:11:03 +07:00
commit dd27695bed
4 changed files with 23 additions and 9 deletions

View file

@ -121,7 +121,7 @@ class Builder implements LoggerAwareInterface
$pluginFactory = $this->buildPluginFactory($build);
$pluginFactory->addConfigFromFile(PHPCI_DIR . "/pluginconfig.php");
$this->pluginExecutor = new Plugin\Util\Executor($pluginFactory, $this);
$this->pluginExecutor = new Plugin\Util\Executor($pluginFactory, $this->buildLogger);
$this->commandExecutor = new CommandExecutor(
$this->buildLogger,

View file

@ -97,7 +97,7 @@ class WebhookController extends \PHPCI\Controller
}
try {
$this->_buildStore->save($build);
$this->buildStore->save($build); /** bugfix: Errors with PHPCI GitHub hook #296 */
} catch (\Exception $ex) {
header('HTTP/1.1 500 Internal Server Error');
header('Ex: ' . $ex->getMessage());

View file

@ -20,7 +20,14 @@ use PHPCI\Model\Build;
*/
class Codeception implements \PHPCI\Plugin
{
protected $args;
/**
* @var string
*/
protected $args = '';
/**
* @var Builder
*/
protected $phpci;
/**
@ -30,14 +37,13 @@ class Codeception implements \PHPCI\Plugin
public function __construct(Builder $phpci, Build $build, array $options = array())
{
$this->phpci = $phpci;
$this->phpci = $phpci;
if (isset($options['config'])) {
$this->xmlConfigFile = $options['config'];
}
if (isset($options['args'])) {
$this->args = $options['args'];
$this->args = (string) $options['args'];
}
}
@ -69,9 +75,9 @@ class Codeception implements \PHPCI\Plugin
return false;
}
$cmd = 'cd "%s" && ' . $codecept . ' run -c "%s"';
$cmd = 'cd "%s" && ' . $codecept . ' run -c "%s" '. $this->args;
if (IS_WIN) {
$cmd = 'cd /d "%s" && ' . $codecept . ' run -c "%s"';
$cmd = 'cd /d "%s" && ' . $codecept . ' run -c "%s" '. $this->args;
}
$success = $this->phpci->executeCommand($cmd, $this->phpci->buildPath, $this->phpci->buildPath . $configPath);

View file

@ -19,7 +19,7 @@
<ul class="nav nav-pills nav-stacked">
<li><a href="<?php echo PHPCI_URL ?>build/rebuild/<?php print $build->getId(); ?>"><i class="icon-cog"></i> Rebuild</a></li>
<?php if($this->User()->getIsAdmin()): ?>
<li><a href="#" id="delete-build"><i class="icon-trash"></i> Delete Build</a></li>
<li><a href="<?php echo PHPCI_URL ?>build/delete/<?php print $build->getId(); ?>" id="delete-build"><i class="icon-trash"></i> Delete Build</a></li>
<?php endif; ?>
</ul>
</div>
@ -44,5 +44,13 @@ foreach ($plugins as $plugin) {
<script>
$(document).ready(function() {
PHPCI.renderPlugins();
$('#delete-build').on('click', function (e) {
e.preventDefault();
confirmDelete(
"<?php echo PHPCI_URL ?>build/delete/<?php print $build->getId(); ?>", "Build"
).onCloseConfirmed = function () {window.location = '/'};
});
});
</script>