Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
ae1e4f9d10 |
|
@ -21,7 +21,6 @@ use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use PHPCI\Service\UserService;
|
use PHPCI\Service\UserService;
|
||||||
use Symfony\Component\Console\Question\ConfirmationQuestion;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Install console command - Installs PHPCI.
|
* Install console command - Installs PHPCI.
|
||||||
|
@ -254,14 +253,6 @@ class InstallCommand extends Command
|
||||||
|
|
||||||
$rtn = [];
|
$rtn = [];
|
||||||
|
|
||||||
$helper = $this->getHelper('question');
|
|
||||||
$question = new ConfirmationQuestion('Use beanstalkd to manage build queue? ', true);
|
|
||||||
|
|
||||||
if (!$helper->ask($input, $output, $question)) {
|
|
||||||
$output->writeln('<error>Skipping beanstalkd configuration.</error>');
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$rtn['host'] = $input->getOption('queue-server')) {
|
if (!$rtn['host'] = $input->getOption('queue-server')) {
|
||||||
$rtn['host'] = $dialog->ask($output, 'Enter your beanstalkd hostname [localhost]: ', 'localhost');
|
$rtn['host'] = $dialog->ask($output, 'Enter your beanstalkd hostname [localhost]: ', 'localhost');
|
||||||
}
|
}
|
||||||
|
|
|
@ -200,10 +200,6 @@ class BuildController extends \PHPCI\Controller
|
||||||
|
|
||||||
$build = $this->buildService->createDuplicateBuild($copy);
|
$build = $this->buildService->createDuplicateBuild($copy);
|
||||||
|
|
||||||
if ($this->buildService->queueError) {
|
|
||||||
$_SESSION['global_error'] = Lang::get('add_to_queue_failed');
|
|
||||||
}
|
|
||||||
|
|
||||||
$response = new b8\Http\Response\RedirectResponse();
|
$response = new b8\Http\Response\RedirectResponse();
|
||||||
$response->setHeader('Location', PHPCI_URL.'build/view/' . $build->getId());
|
$response->setHeader('Location', PHPCI_URL.'build/view/' . $build->getId());
|
||||||
return $response;
|
return $response;
|
||||||
|
|
|
@ -116,10 +116,6 @@ class ProjectController extends PHPCI\Controller
|
||||||
$email = $_SESSION['phpci_user']->getEmail();
|
$email = $_SESSION['phpci_user']->getEmail();
|
||||||
$build = $this->buildService->createBuild($project, null, urldecode($branch), $email);
|
$build = $this->buildService->createBuild($project, null, urldecode($branch), $email);
|
||||||
|
|
||||||
if ($this->buildService->queueError) {
|
|
||||||
$_SESSION['global_error'] = Lang::get('add_to_queue_failed');
|
|
||||||
}
|
|
||||||
|
|
||||||
$response = new b8\Http\Response\RedirectResponse();
|
$response = new b8\Http\Response\RedirectResponse();
|
||||||
$response->setHeader('Location', PHPCI_URL.'build/view/' . $build->getId());
|
$response->setHeader('Location', PHPCI_URL.'build/view/' . $build->getId());
|
||||||
return $response;
|
return $response;
|
||||||
|
|
|
@ -372,9 +372,6 @@ PHPCI',
|
||||||
'project_id_argument' => 'A project ID',
|
'project_id_argument' => 'A project ID',
|
||||||
'commit_id_option' => 'Commit ID to build',
|
'commit_id_option' => 'Commit ID to build',
|
||||||
'branch_name_option' => 'Branch to build',
|
'branch_name_option' => 'Branch to build',
|
||||||
'add_to_queue_failed' => 'Build created successfully, but failed to add to build queue. This usually happens
|
|
||||||
when PHPCI is set to use a beanstalkd server that does not exist,
|
|
||||||
or your beanstalkd server has stopped.',
|
|
||||||
|
|
||||||
// Run Command
|
// Run Command
|
||||||
'run_all_pending' => 'Run all pending PHPCI builds.',
|
'run_all_pending' => 'Run all pending PHPCI builds.',
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
use Phinx\Migration\AbstractMigration;
|
|
||||||
use Phinx\Db\Adapter\MysqlAdapter;
|
|
||||||
|
|
||||||
class ProjectTableDefaults extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function change()
|
|
||||||
{
|
|
||||||
$this->table('project')
|
|
||||||
->changeColumn('build_config', MysqlAdapter::PHINX_TYPE_TEXT, array('null' => true))
|
|
||||||
->changeColumn('archived', MysqlAdapter::PHINX_TYPE_INTEGER, array(
|
|
||||||
'length' => MysqlAdapter::INT_TINY,
|
|
||||||
'default' => 0,
|
|
||||||
))
|
|
||||||
->save();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -96,7 +96,7 @@ class Project extends ProjectBase
|
||||||
$info = $this->data['access_information'];
|
$info = $this->data['access_information'];
|
||||||
|
|
||||||
// Handle old-format (serialized) access information first:
|
// Handle old-format (serialized) access information first:
|
||||||
if (!empty($info) && !in_array(substr($info, 0, 1), array('{', '['))) {
|
if (!empty($info) && substr($info, 0, 1) != '{') {
|
||||||
$data = unserialize($info);
|
$data = unserialize($info);
|
||||||
} else {
|
} else {
|
||||||
$data = json_decode($info, true);
|
$data = json_decode($info, true);
|
||||||
|
|
|
@ -65,7 +65,8 @@ class Deployer implements \PHPCI\Plugin
|
||||||
'source' => 'PHPCI',
|
'source' => 'PHPCI',
|
||||||
'url' => $this->phpci->interpolate('%BUILD_URI%'),
|
'url' => $this->phpci->interpolate('%BUILD_URI%'),
|
||||||
'branch' => $this->phpci->interpolate('%BRANCH%'),
|
'branch' => $this->phpci->interpolate('%BRANCH%'),
|
||||||
'update_only' => $this->updateOnly
|
'update_only' => $this->updateOnly,
|
||||||
|
'commit' => $this->phpci->interpolate('%COMMIT%'),
|
||||||
));
|
));
|
||||||
|
|
||||||
return $response['success'];
|
return $response['success'];
|
||||||
|
|
5
PHPCI/Plugin/PhpCpd.php
Executable file → Normal file
5
PHPCI/Plugin/PhpCpd.php
Executable file → Normal file
|
@ -50,12 +50,17 @@ class PhpCpd implements \PHPCI\Plugin
|
||||||
$this->build = $build;
|
$this->build = $build;
|
||||||
|
|
||||||
$this->path = $phpci->buildPath;
|
$this->path = $phpci->buildPath;
|
||||||
|
$this->standard = 'PSR1';
|
||||||
$this->ignore = $phpci->ignore;
|
$this->ignore = $phpci->ignore;
|
||||||
|
|
||||||
if (!empty($options['path'])) {
|
if (!empty($options['path'])) {
|
||||||
$this->path = $phpci->buildPath . $options['path'];
|
$this->path = $phpci->buildPath . $options['path'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($options['standard'])) {
|
||||||
|
$this->standard = $options['standard'];
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($options['ignore'])) {
|
if (!empty($options['ignore'])) {
|
||||||
$this->ignore = $options['ignore'];
|
$this->ignore = $options['ignore'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,11 +30,6 @@ class BuildService
|
||||||
*/
|
*/
|
||||||
protected $buildStore;
|
protected $buildStore;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
public $queueError = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param BuildStore $buildStore
|
* @param BuildStore $buildStore
|
||||||
*/
|
*/
|
||||||
|
@ -160,30 +155,27 @@ class BuildService
|
||||||
}
|
}
|
||||||
|
|
||||||
$config = Config::getInstance();
|
$config = Config::getInstance();
|
||||||
|
|
||||||
$settings = $config->get('phpci.worker', []);
|
$settings = $config->get('phpci.worker', []);
|
||||||
|
|
||||||
if (!empty($settings['host']) && !empty($settings['queue'])) {
|
if (!empty($settings['host']) && !empty($settings['queue'])) {
|
||||||
try {
|
$jobData = array(
|
||||||
$jobData = array(
|
'type' => 'phpci.build',
|
||||||
'type' => 'phpci.build',
|
'build_id' => $build->getId(),
|
||||||
'build_id' => $build->getId(),
|
);
|
||||||
);
|
|
||||||
|
|
||||||
if ($config->get('using_custom_file')) {
|
if ($config->get('using_custom_file')) {
|
||||||
$jobData['config'] = $config->getArray();
|
$jobData['config'] = $config->getArray();
|
||||||
}
|
|
||||||
|
|
||||||
$pheanstalk = new Pheanstalk($settings['host']);
|
|
||||||
$pheanstalk->useTube($settings['queue']);
|
|
||||||
$pheanstalk->put(
|
|
||||||
json_encode($jobData),
|
|
||||||
PheanstalkInterface::DEFAULT_PRIORITY,
|
|
||||||
PheanstalkInterface::DEFAULT_DELAY,
|
|
||||||
$config->get('phpci.worker.job_timeout', 600)
|
|
||||||
);
|
|
||||||
} catch (\Exception $ex) {
|
|
||||||
$this->queueError = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$pheanstalk = new Pheanstalk($settings['host']);
|
||||||
|
$pheanstalk->useTube($settings['queue']);
|
||||||
|
$pheanstalk->put(
|
||||||
|
json_encode($jobData),
|
||||||
|
PheanstalkInterface::DEFAULT_PRIORITY,
|
||||||
|
PheanstalkInterface::DEFAULT_DELAY,
|
||||||
|
$config->get('phpci.worker.job_timeout', 600)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -292,14 +292,6 @@
|
||||||
|
|
||||||
<!-- Main content -->
|
<!-- Main content -->
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<?php
|
|
||||||
if (!empty($_SESSION['global_error'])) {
|
|
||||||
$message = $_SESSION['global_error'];
|
|
||||||
unset($_SESSION['global_error']);
|
|
||||||
print '<div class="alert alert-danger">' . $message . '</div>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php print $content; ?>
|
<?php print $content; ?>
|
||||||
</section><!-- /.content -->
|
</section><!-- /.content -->
|
||||||
</aside><!-- /.content-wrapper -->
|
</aside><!-- /.content-wrapper -->
|
||||||
|
|
Loading…
Reference in a new issue