Commands fixes

This commit is contained in:
Dmitry Khomutov 2017-02-05 11:18:33 +07:00
parent 0ab4acd72f
commit ed532bad7d
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9
24 changed files with 100 additions and 479 deletions

View file

@ -1,16 +1,8 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCensor\Command;
use PHPCensor\Service\UserService;
use PHPCensor\Helper\Lang;
use PHPCensor\Store\UserStore;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
@ -21,9 +13,7 @@ use Symfony\Component\Console\Question\Question;
/**
* Create admin command - creates an admin user
*
* @author Wogan May (@woganmay)
* @package PHPCI
* @subpackage Console
* @author Wogan May (@woganmay)
*/
class CreateAdminCommand extends Command
{
@ -46,7 +36,7 @@ class CreateAdminCommand extends Command
{
$this
->setName('php-censor:create-admin')
->setDescription(Lang::get('create_admin_user'));
->setDescription('Create an admin user');
}
/**

View file

@ -1,15 +1,7 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCensor\Command;
use PHPCensor\Helper\Lang;
use PHPCensor\Service\BuildService;
use PHPCensor\Store\ProjectStore;
use Symfony\Component\Console\Command\Command;
@ -21,9 +13,7 @@ use Symfony\Component\Console\Output\OutputInterface;
/**
* Create build command - creates a build for a project
*
* @author Jérémy DECOOL (@jdecool)
* @package PHPCI
* @subpackage Console
* @author Jérémy DECOOL (@jdecool)
*/
class CreateBuildCommand extends Command
{
@ -56,10 +46,10 @@ class CreateBuildCommand extends Command
{
$this
->setName('php-censor:create-build')
->setDescription(Lang::get('create_build_project'))
->addArgument('projectId', InputArgument::REQUIRED, Lang::get('project_id_argument'))
->addOption('commit', null, InputOption::VALUE_OPTIONAL, Lang::get('commit_id_option'))
->addOption('branch', null, InputOption::VALUE_OPTIONAL, Lang::get('branch_name_option'));
->setDescription('Create a build for a project')
->addArgument('projectId', InputArgument::REQUIRED, 'A project ID')
->addOption('commit', null, InputOption::VALUE_OPTIONAL, 'Commit ID to build')
->addOption('branch', null, InputOption::VALUE_OPTIONAL, 'Branch to build');
}
/**
@ -78,9 +68,9 @@ class CreateBuildCommand extends Command
try {
$this->buildService->createBuild($project, $commitId, $branch);
$output->writeln(Lang::get('build_created'));
$output->writeln('Build Created');
} catch (\Exception $e) {
$output->writeln(sprintf('<error>%s</error>', Lang::get('failed')));
$output->writeln('<error>Failed</error>');
$output->writeln(sprintf('<error>%s</error>', $e->getMessage()));
}
}

View file

@ -82,10 +82,9 @@ class InstallCommand extends Command
}
$output->writeln('');
$conf = [];
$conf = [];
$conf['b8']['database'] = $db;
$conf['php-censor'] = $this->getConfigInformation($input, $output);
$conf['php-censor'] = $this->getConfigInformation($input, $output);
$this->writeConfigFile($conf);
$this->setupDatabase($output);
@ -375,8 +374,9 @@ class InstallCommand extends Command
]
];
$dbPort = (integer)$dbPort;
if ($dbPort) {
$dbServers[0]['port'] = (integer)$dbPort;
$dbServers[0]['port'] = $dbPort;
}
$db['servers']['read'] = $dbServers;
@ -402,8 +402,8 @@ class InstallCommand extends Command
{
try {
$dns = $db['type'] . ':host=' . $db['servers']['write'][0]['host'];
if (isset($db['servers']['write'][0]['host'])) {
$dns .= ';port=' . (integer)$db['servers']['write'][0]['host'];
if (isset($db['servers']['write'][0]['port'])) {
$dns .= ';port=' . (integer)$db['servers']['write'][0]['port'];
}
$dns .= ';dbname=' . $db['name'];

View file

@ -1,18 +1,10 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCensor\Command;
use b8\Store\Factory;
use b8\HttpClient;
use Monolog\Logger;
use PHPCensor\Helper\Lang;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
@ -22,9 +14,7 @@ use PHPCensor\Model\Build;
/**
* Run console command - Poll github for latest commit id
*
* @author Jimmy Cleuren <jimmy.cleuren@gmail.com>
* @package PHPCI
* @subpackage Console
* @author Jimmy Cleuren <jimmy.cleuren@gmail.com>
*/
class PollCommand extends Command
{
@ -43,7 +33,7 @@ class PollCommand extends Command
{
$this
->setName('php-censor:poll-github')
->setDescription(Lang::get('poll_github'));
->setDescription('Poll GitHub to check if we need to start a build.');
}
/**
@ -58,16 +48,16 @@ class PollCommand extends Command
$token = $this->settings['php-censor']['github']['token'];
if (!$token) {
$this->logger->error(Lang::get('no_token'));
$this->logger->error('No GitHub token found');
return;
}
$buildStore = Factory::getStore('Build');
$this->logger->addInfo(Lang::get('finding_projects'));
$this->logger->addInfo('Finding projects to poll');
$projectStore = Factory::getStore('Project');
$result = $projectStore->getWhere();
$this->logger->addInfo(Lang::get('found_n_projects', count($result['items'])));
$this->logger->addInfo(sprintf('Found %d projects', count($result['items'])));
foreach ($result['items'] as $project) {
$http = new HttpClient('https://api.github.com');
@ -77,12 +67,10 @@ class PollCommand extends Command
$last_committer = $commits['body'][0]['commit']['committer']['email'];
$message = $commits['body'][0]['commit']['message'];
$this->logger->info(Lang::get('last_commit_is', $project->getTitle(), $last_commit));
$this->logger->info(sprintf('Last commit to GitHub for %s is %s', $project->getTitle(), $last_commit));
if (!$project->getArchived() && ($project->getLastCommit() != $last_commit && $last_commit != "")) {
$this->logger->info(
Lang::get('adding_new_build')
);
$this->logger->info('Last commit is different to database, adding new build.');
$build = new Build();
$build->setProjectId($project->getId());
@ -102,6 +90,6 @@ class PollCommand extends Command
}
}
$this->logger->addInfo(Lang::get('finished_processing_builds'));
$this->logger->addInfo('Finished processing builds.');
}
}

View file

@ -1,13 +1,5 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCensor\Command;
use b8\Store\Factory;
@ -21,9 +13,7 @@ use Symfony\Component\Console\Output\OutputInterface;
/**
* Re-runs the last run build.
*
* @author Dan Cryer <dan@block8.co.uk>
* @package PHPCI
* @subpackage Console
* @author Dan Cryer <dan@block8.co.uk>
*/
class RebuildCommand extends Command
{

View file

@ -1,29 +1,18 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCensor\Command;
use b8\Store\Factory;
use Monolog\Logger;
use PHPCensor\BuildFactory;
use PHPCensor\Helper\Lang;
use PHPCensor\Logging\OutputLogHandler;
use PHPCensor\Service\BuildService;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* @author Dan Cryer <dan@block8.co.uk>
* @package PHPCI
* @subpackage Console
* @author Dan Cryer <dan@block8.co.uk>
*/
class RebuildQueueCommand extends Command
{
@ -69,7 +58,7 @@ class RebuildQueueCommand extends Command
$store = Factory::getStore('Build');
$result = $store->getByStatus(0);
$this->logger->addInfo(Lang::get('found_n_builds', count($result['items'])));
$this->logger->addInfo(sprintf('Found %d builds', count($result['items'])));
$buildService = new BuildService($store);

View file

@ -1,17 +1,9 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCensor\Command;
use b8\Config;
use Monolog\Logger;
use PHPCensor\Helper\Lang;
use PHPCensor\Logging\BuildDBLogHandler;
use PHPCensor\Logging\LoggedBuildContextTidier;
use PHPCensor\Logging\OutputLogHandler;
@ -27,9 +19,7 @@ use PHPCensor\Model\Build;
/**
* Run console command - Runs any pending builds.
*
* @author Dan Cryer <dan@block8.co.uk>
* @package PHPCI
* @subpackage Console
* @author Dan Cryer <dan@block8.co.uk>
*/
class RunCommand extends Command
{
@ -62,8 +52,8 @@ class RunCommand extends Command
{
$this
->setName('php-censor:run-builds')
->setDescription(Lang::get('run_all_pending'))
->addOption('debug', null, null, 'Run PHP Censor in Debug Mode');
->setDescription('Run all pending PHP Censor builds')
->addOption('debug', null, null, 'Run PHP Censor in debug mode');
}
/**
@ -90,13 +80,13 @@ class RunCommand extends Command
$running = $this->validateRunningBuilds();
$this->logger->pushProcessor(new LoggedBuildContextTidier());
$this->logger->addInfo(Lang::get('finding_builds'));
$this->logger->addInfo('Finding builds to process');
/** @var BuildStore $store */
$store = Factory::getStore('Build');
$result = $store->getByStatus(Build::STATUS_PENDING, $this->maxBuilds);
$this->logger->addInfo(Lang::get('found_n_builds', count($result['items'])));
$this->logger->addInfo(sprintf('Found %d builds', count($result['items'])));
$builds = 0;
@ -106,7 +96,7 @@ class RunCommand extends Command
// Skip build (for now) if there's already a build running in that project:
if (in_array($build->getProjectId(), $running)) {
$this->logger->addInfo(Lang::get('skipping_build', $build->getId()));
$this->logger->addInfo(sprintf('Skipping Build %d - Project build already in progress.', $build->getId()));
$result['items'][] = $build;
// Re-run build validator:
@ -137,7 +127,7 @@ class RunCommand extends Command
}
$this->logger->addInfo(Lang::get('finished_processing_builds'));
$this->logger->addInfo('Finished processing builds.');
return $builds;
}
@ -164,7 +154,7 @@ class RunCommand extends Command
$start = $build->getStarted()->getTimestamp();
if (($now - $start) > $timeout) {
$this->logger->addInfo(Lang::get('marked_as_failed', $build->getId()));
$this->logger->addInfo(sprintf('Build %d marked as failed due to timeout.', $build->getId()));
$build->setStatus(Build::STATUS_FAILED);
$build->setFinished(new \DateTime());
$store->save($build);

View file

@ -1,11 +1,4 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2015, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCensor\Command;
@ -17,13 +10,10 @@ use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Worker Command - Starts the BuildWorker, which pulls jobs from beanstalkd
*
* @author Dan Cryer <dan@block8.co.uk>
* @package PHPCI
* @subpackage Console
* @author Dan Cryer <dan@block8.co.uk>
*/
class WorkerCommand extends Command
{

View file

@ -34,33 +34,37 @@ class Application extends BaseApplication
/**
* Constructor.
*
* @param string $name The name of the application
* @param string $version The version of the application
* @param LoggerConfig $loggerConfig Logger config
* @param string $name The name of the application
* @param string $version The version of the application
*/
public function __construct($name = 'PHP Censor - Continuous Integration for PHP', $version = '', LoggerConfig $loggerConfig = null)
public function __construct($name = 'PHP Censor - Continuous Integration for PHP', $version = '')
{
parent::__construct($name, $version);
$loggerConfig = LoggerConfig::newFromFile(APP_DIR . 'loggerconfig.php');
$applicationConfig = Config::getInstance();
$databaseSettings = $applicationConfig->get('b8.database', []);
$phinxSettings = [
'paths' => [
'migrations' => 'src/PHPCensor/Migrations',
],
'environments' => [
'default_migration_table' => 'migration',
'default_database' => 'php-censor',
'php-censor' => [
'adapter' => $databaseSettings['type'],
'host' => $databaseSettings['servers']['write'][0]['host'],
'name' => $databaseSettings['name'],
'user' => $databaseSettings['username'],
'pass' => $databaseSettings['password'],
$phinxSettings = [];
if ($databaseSettings) {
$phinxSettings = [
'paths' => [
'migrations' => 'src/PHPCensor/Migrations',
],
],
];
'environments' => [
'default_migration_table' => 'migration',
'default_database' => 'php-censor',
'php-censor' => [
'adapter' => $databaseSettings['type'],
'host' => $databaseSettings['servers']['write'][0]['host'],
'name' => $databaseSettings['name'],
'user' => $databaseSettings['username'],
'pass' => $databaseSettings['password'],
],
],
];
}
if (!empty($databaseSettings['port'])) {
$phinxSettings['environments']['php-censor']['port'] = (integer)$databaseSettings['port'];

View file

@ -198,7 +198,6 @@ Services</a> sektionen under dit Bitbucket-repository.',
'result' => 'Resultat',
'ok' => 'OK',
'took_n_seconds' => 'Tog %d sekunder',
'build_created' => 'Build Oprettet',
'build_started' => 'Build Startet',
'build_finished' => 'Build Afsluttet',
'test_message' => 'Message',
@ -290,32 +289,6 @@ du kører composer update.',
'not_installed' => 'PHP Censor lader til ikke at være installeret.',
'install_instead' => 'Installér venligst PHP Censor via php-censor:install istedet.',
// Poll Command
'poll_github' => 'Check via GitHub om et build skal startes.',
'no_token' => 'GitHub-token findes ikke',
'finding_projects' => 'Finder projekter der kan forespørges',
'found_n_projects' => '%d projekter fundet',
'last_commit_is' => 'Sidste commit til GitHub for %s er %s',
'adding_new_build' => 'Sidste commit er forskellig fra databasen, tilføjer nyt build.',
'finished_processing_builds' => 'Kørsel af builds afsluttet.',
// Create Admin
'create_admin_user' => 'Tilføj en administrator',
'incorrect_format' => 'Forkert format',
// Create Build Command
'create_build_project' => 'Create a build for a project',
'project_id_argument' => 'A project ID',
'commit_id_option' => 'Commit ID to build',
'branch_name_option' => 'Branch to build',
// Run Command
'run_all_pending' => 'Kør alle PHP Censor builds i køen.',
'finding_builds' => 'Finder builds der skal køres',
'found_n_builds' => '%d builds fundet',
'skipping_build' => 'Springer over Build %d - projektet kører et build lige nu.',
'marked_as_failed' => 'Build %d blev markeret som fejlet pga. timeout.',
// Builder
'missing_app_yml' => 'Dette projekt har ingen .php-censor.yml (.phpci.yml|phpci.yml) fil, eller filen er tom.',
'build_success' => 'BUILD SUCCES',

View file

@ -208,7 +208,6 @@ generiert. Um es zu verwenden, fügen Sie einfach den folgenden Public Key im Ab
'result' => 'Resultat',
'ok' => 'OK',
'took_n_seconds' => 'Benötigte %d Sekunden',
'build_created' => 'Build erstellt',
'build_started' => 'Build gestartet',
'build_finished' => 'Build abgeschlossen',
'test_message' => 'Nachricht',
@ -313,32 +312,6 @@ generiert. Um es zu verwenden, fügen Sie einfach den folgenden Public Key im Ab
'not_installed' => 'PHP Censor scheint nicht installiert zu sein.',
'install_instead' => 'Bitte installieren Sie PHP Censor stattdessen via php-censor:install.',
// Poll Command
'poll_github' => 'GitHub abfragen, um herauszufinden, ob ein Build gestartet werden muss.',
'no_token' => 'Kein GitHub-Token gefunden',
'finding_projects' => 'Suche Projekte, um diese abzufragen',
'found_n_projects' => '%d Projekte gefunden',
'last_commit_is' => 'Der letzte Commit zu GitHub für %s ist %s',
'adding_new_build' => 'Letzter Commit unterscheidet sich von der Datenbank, füge neuen Build hinzu.',
'finished_processing_builds' => 'Bearbeiten der Builds abgeschlossen.',
// Create Admin
'create_admin_user' => 'Administratorenbenutzer erstellen',
'incorrect_format' => 'Falsches Format',
// Create Build Command
'create_build_project' => 'Create a build for a project',
'project_id_argument' => 'A project ID',
'commit_id_option' => 'Commit ID to build',
'branch_name_option' => 'Branch to build',
// Run Command
'run_all_pending' => 'Führe alle ausstehenden PHP Censor Builds aus.',
'finding_builds' => 'Suche verarbeitbare Builds',
'found_n_builds' => '%d Builds gefunden',
'skipping_build' => 'Überspringe Build %d - Es wird bereits ein Build auf diesem Projekt ausgeführt.',
'marked_as_failed' => 'Build %d wegen Zeitüberschreitung als fehlgeschlagen markiert.',
// Builder
'missing_app_yml' => 'Dieses Projekt beinhaltet keine .php-censor.yml (.phpci.yml|phpci.yml)-Datei, oder sie ist leer.',
'build_success' => 'BUILD ERFOLGREICH',

View file

@ -199,7 +199,6 @@ Services</a> του Bitbucket αποθετηρίου σας.',
'result' => 'Αποτέλεσμα',
'ok' => 'ΟΚ',
'took_n_seconds' => 'Χρειάστηκαν %d δευτερόλεπτα',
'build_created' => 'Η κατασκευή δημιουργήθηκε',
'build_started' => 'Η κατασκευή άρχισε',
'build_finished' => 'Η κατασκευή ολοκληρώθηκε',
'test_message' => 'Message',
@ -292,32 +291,6 @@ Services</a> του Bitbucket αποθετηρίου σας.',
'not_installed' => 'Το PHP Censor δεν φένεται να είναι εγκατεστημένο',
'install_instead' => 'Παρακαλούμε εγκαταστήστε το PHP Censor καλύτερα με το php-censor:install αντ \'αυτού.',
// Poll Command
'poll_github' => 'Δημοσκόπηση στο GitHub για να ελέγξετε αν θα πρέπει να ξεκινήσει μια κατασκευή.',
'no_token' => 'Δεν βρέθηκε GitHub token',
'finding_projects' => 'Αναζήτηση έργων για δημοσκόπηση',
'found_n_projects' => 'Βρέθηκαν %d έργα',
'last_commit_is' => 'H τελευταία συνεισφορά στο GitHub για %s είναι %s',
'adding_new_build' => 'Τελευταία συνεισφορά είναι διαφορετική από τη βάση δεδομένων, γίνεται προσθήκη νέας κατασκευής.',
'finished_processing_builds' => 'Ολοκληρώθηκε η επεξεργασία κατασκευής.',
// Create Admin
'create_admin_user' => 'Δημιουργήστε ένα χρήστη διαχειριστή',
'incorrect_format' => 'Λανθασμένη μορφοποίηση',
// Create Build Command
'create_build_project' => 'Create a build for a project',
'project_id_argument' => 'A project ID',
'commit_id_option' => 'Commit ID to build',
'branch_name_option' => 'Branch to build',
// Run Command
'run_all_pending' => 'Εκτελέστε όλες τις εκκρεμείς PHP Censor κατασκευές.',
'finding_builds' => 'Αναζήτηση κατασκευών για επεξεργασία',
'found_n_builds' => 'Βρέθηκαν %d κατασκευές',
'skipping_build' => 'Παράκαμψη κατασκευής %d - Η διαδικασία κατασκευής του έργου βρίσκεται ήδη σε εξέλιξη.',
'marked_as_failed' => 'Η κατασκεύη %d επισημάνθηκε ως αποτυχημένη λόγω χρονικού ορίου',
// Builder
'missing_app_yml' => 'Το έργο δεν περιέχει το αρχείο .php-censor.yml (.phpci.yml|phpci.yml) ή είναι άδειο.',
'build_success' => 'ΚΑΤΑΣΚΕΥΗ ΕΠΙΤΥΧΗΣ',

View file

@ -227,7 +227,6 @@ PHP Censor',
'result' => 'Result',
'ok' => 'OK',
'took_n_seconds' => 'Took %d seconds',
'build_created' => 'Build Created',
'build_started' => 'Build Started',
'build_finished' => 'Build Finished',
'test_message' => 'Message',
@ -343,35 +342,11 @@ PHP Censor',
'not_installed' => 'PHP Censor does not appear to be installed.',
'install_instead' => 'Please install PHP Censor via php-censor:install instead.',
// Poll Command
'poll_github' => 'Poll GitHub to check if we need to start a build.',
'no_token' => 'No GitHub token found',
'finding_projects' => 'Finding projects to poll',
'found_n_projects' => 'Found %d projects',
'last_commit_is' => 'Last commit to GitHub for %s is %s',
'adding_new_build' => 'Last commit is different to database, adding new build.',
'finished_processing_builds' => 'Finished processing builds.',
// Create Admin
'create_admin_user' => 'Create an admin user',
'incorrect_format' => 'Incorrect format',
// Create Build Command
'create_build_project' => 'Create a build for a project',
'project_id_argument' => 'A project ID',
'commit_id_option' => 'Commit ID 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 PHP Censor is set to use a beanstalkd server that does not exist,
or your beanstalkd server has stopped.',
// Run Command
'run_all_pending' => 'Run all pending PHP Censor builds.',
'finding_builds' => 'Finding builds to process',
'found_n_builds' => 'Found %d builds',
'skipping_build' => 'Skipping Build %d - Project build already in progress.',
'marked_as_failed' => 'Build %d marked as failed due to timeout.',
// Builder
'missing_app_yml' => 'This project does not contain a .php-censor.yml (.phpci.yml|phpci.yml) file, or it is empty.',
'build_success' => 'BUILD SUCCESS',

View file

@ -203,7 +203,6 @@ PHP Censor',
'result' => 'Resultado',
'ok' => 'OK',
'took_n_seconds' => 'Tomó %d segundos',
'build_created' => 'Build Creado',
'build_started' => 'Build Comenzado',
'build_finished' => 'Build Terminado',
@ -287,26 +286,6 @@ PHP Censor',
'not_installed' => 'PHP Censor no está instalado.',
'install_instead' => 'Por favor, instala PHP Censor via php-censor:install.',
// Poll Command
'poll_github' => 'Chequear en GitHub si se necesita comenzar un Build.',
'no_token' => 'No se encontró ningún token GitHub',
'finding_projects' => 'Buscando proyectos para chequear',
'found_n_projects' => 'Se encontraron %d proyectos',
'last_commit_is' => 'El último commit en GitHub para %s es %s',
'adding_new_build' => 'Último commit es diferente a la base de datos, agregando nuevo build.',
'finished_processing_builds' => 'Fin de procesamiento de builds.',
// Create Admin
'create_admin_user' => 'Crear un usuario Admin',
'incorrect_format' => 'Formato incorrecto',
// Run Command
'run_all_pending' => 'Ejecutar todos los builds PHP Censor pendientes.',
'finding_builds' => 'Buscando builds a procesar',
'found_n_builds' => 'Se encontraron %d builds',
'skipping_build' => 'Saltando Build %d - Build del proyecto ya en ejecución.',
'marked_as_failed' => 'Build %d falló debido a timeout.',
// Builder
'missing_app_yml' => 'Este proyecto no contiene el archivo .php-censor.yml (.phpci.yml|phpci.yml) o está vacío.',
'build_success' => 'BUILD EXITOSO',

View file

@ -203,7 +203,6 @@ PHP Censor',
'result' => 'Resultat',
'ok' => 'OK',
'took_n_seconds' => 'Exécuté en %d secondes',
'build_created' => 'Build créé',
'build_started' => 'Build démarré',
'build_finished' => 'Build terminé',
'test_message' => 'Message',
@ -307,32 +306,6 @@ PHP Censor',
'not_installed' => 'PHP Censor n\'a pas l\'air d\'être installé.',
'install_instead' => 'Merci d\'installer PHP Censor grâce à la commande php-censor:install.',
// Poll Command
'poll_github' => 'Demander à GitHub de vérifier si nous devons démarrer un build.',
'no_token' => 'Aucun token GitHub n\'a été trouvé',
'finding_projects' => 'Recherche des projets à sonder',
'found_n_projects' => '%d projets trouvés',
'last_commit_is' => 'Le dernier commit sur GitHub pour %s est %s',
'adding_new_build' => 'Le dernier commit est différent de celui présent en base de données, ajout d\'un nouveau build.',
'finished_processing_builds' => 'Traitement des builds terminé.',
// Create Admin
'create_admin_user' => 'Créer un utilisateur admin',
'incorrect_format' => 'Format incorrect',
// Create Build Command
'create_build_project' => 'Créer un build projet',
'project_id_argument' => 'ID du projet',
'commit_id_option' => 'ID du commit',
'branch_name_option' => 'Branche',
// Run Command
'run_all_pending' => 'Démarrage de tout les builds PHP Censor en attente.',
'finding_builds' => 'Découverte des builds à traiter',
'found_n_builds' => '%d builds trouvés',
'skipping_build' => 'Saut du build %d - Un build sur le projet est déjà en cours.',
'marked_as_failed' => 'Le build %d a été marqué échoué à cause d\'un timeout.',
// Builder
'missing_app_yml' => 'Ce projet ne contient pas de fichier .php-censor.yml (.phpci.yml|phpci.yml), ou il est vide.',
'build_success' => 'BUILD RÉUSSI',

View file

@ -200,7 +200,6 @@ PHP Censor',
'result' => 'Risultati',
'ok' => 'OK',
'took_n_seconds' => 'Sono stati impiegati %d seconds',
'build_created' => 'Build Creata',
'build_started' => 'Build Avviata',
'build_finished' => 'Build Terminata',
'test_message' => 'Message',
@ -292,32 +291,6 @@ PHP Censor',
'not_installed' => 'PHP Censor sembra non essere installato.',
'install_instead' => 'Per favore installa PHP Censor tramite php-censor:install.',
// Poll Command
'poll_github' => 'Richiesta a GitHub per verificare se è necessario avviare una build.',
'no_token' => 'Nessuno token per GitHub trovato',
'finding_projects' => 'Ricerca dei progetti da aggiornare',
'found_n_projects' => 'Trovati %d progetti',
'last_commit_is' => 'Ultimo commit su GitHub per %s è %s',
'adding_new_build' => 'L\'ultimo commit è diverso da quello registrato, new build aggiunta.',
'finished_processing_builds' => 'Terminato di processare le build.',
// Create Admin
'create_admin_user' => 'Crea un nuovo utente amministrarore',
'incorrect_format' => 'Formato errato',
// Create Build Command
'create_build_project' => 'Create a build for a project',
'project_id_argument' => 'A project ID',
'commit_id_option' => 'Commit ID to build',
'branch_name_option' => 'Branch to build',
// Run Command
'run_all_pending' => 'Esegui tutte le build in attesa su PHP Censor.',
'finding_builds' => 'Ricerca delel build da processare',
'found_n_builds' => 'Trovate %d build',
'skipping_build' => 'Saltata la build %d - La build del progetto è già in corso.',
'marked_as_failed' => 'Build %d è stata contrassegnata come fallita per un timeout.',
// Builder
'missing_app_yml' => 'Questo progetto non contiene il file .php-censor.yml (.phpci.yml|phpci.yml), o il file è vuoto.',
'build_success' => 'BUILD PASSATA',

View file

@ -199,7 +199,6 @@ Services</a> sectie van je Bitbucket repository toegevoegd worden.',
'result' => 'Resultaat',
'ok' => 'OK',
'took_n_seconds' => 'Duurde %d seconden',
'build_created' => 'Build aangemaakt',
'build_started' => 'Build gestart',
'build_finished' => 'Build beëindigd',
'test_message' => 'Message',
@ -292,32 +291,6 @@ keer je composer update uitvoert.',
'not_installed' => 'PHP Censor lijkt niet geïnstalleerd te zijn.',
'install_instead' => 'Gelieve PHP Censor via php-censor:install te installeren.',
// Poll Command
'poll_github' => 'Poll GitHub om te controleren of we een build moeten starten.',
'no_token' => 'Geen GitHub token gevonden',
'finding_projects' => 'Vind projecten om te pollen',
'found_n_projects' => '%d projecten gevonden',
'last_commit_is' => 'Laatste commit naar GitHub voor %s is %s',
'adding_new_build' => 'Laatste commit verschilt van database, nieuwe build wordt toegevoegd',
'finished_processing_builds' => 'Verwerking builds voltooid.',
// Create Admin
'create_admin_user' => 'Administrator-gebruiker aanmaken',
'incorrect_format' => 'Incorrect formaat',
// Create Build Command
'create_build_project' => 'Create a build for a project',
'project_id_argument' => 'A project ID',
'commit_id_option' => 'Commit ID to build',
'branch_name_option' => 'Branch to build',
// Run Command
'run_all_pending' => 'Voer alle wachtende PHP Censor builds uit.',
'finding_builds' => 'Zoekt builds om te verwerken',
'found_n_builds' => '%d builds gevonden',
'skipping_build' => 'Build %d overslaan - Project build reeds aan de gang.',
'marked_as_failed' => 'Build %d gemarkeerd als falende door timeout.',
// Builder
'missing_app_yml' => 'Dit project bevat geen .php-censor.yml (.phpci.yml|phpci.yml) bestand, of het is leeg.',
'build_success' => 'BUILD SUCCES',

View file

@ -202,7 +202,6 @@ Services</a> repozytoria Bitbucket.',
'result' => 'Wynik',
'ok' => 'OK',
'took_n_seconds' => 'Zajęło %d sekund',
'build_created' => 'Budowanie Stworzone',
'build_started' => 'Budowanie Rozpoczęte',
'build_finished' => 'Budowanie Zakończone',
'test_message' => 'Wiadomość',
@ -293,32 +292,6 @@ wywołaniu polecenia composer update.',
'not_installed' => 'Wygląda na to, że PHP Censor nie jest zainstalowane.',
'install_instead' => 'Proszę zainstalować PHP Censor poprzez php-censor:install',
// Poll Command
'poll_github' => 'Odpytuj GitHub, aby sprawdzić czy należy uruchomić budowę.',
'no_token' => 'Nie znaleziono tokena GitHub',
'finding_projects' => 'Szukanie projektów do odpytywania',
'found_n_projects' => 'Znaleziono %d projektów',
'last_commit_is' => 'Ostatni commit do GitHuba dla %s to %s',
'adding_new_build' => 'Ostatni commit jest inny w bazie danych, dodaję nową budowę.',
'finished_processing_builds' => 'Ukończono przetwarzanie budów.',
// Create Admin
'create_admin_user' => 'Utwórz admina',
'incorrect_format' => 'Niepoprawny format',
// Create Build Command
'create_build_project' => 'Utwórz budowanie dla projektu',
'project_id_argument' => 'ID projektu',
'commit_id_option' => 'ID Commita do budowania',
'branch_name_option' => 'Gałąź do budowania',
// Run Command
'run_all_pending' => 'Uruchom wszystkie oczekujące budowy w PHP Censor',
'finding_builds' => 'Szukam budów do przetwarzania.',
'found_n_builds' => 'Znaleziono %d budowań',
'skipping_build' => 'Budowanie %d jest pomijane - Budowanie projektu jest już w toku',
'marked_as_failed' => 'Budowanie %d nie powiodło się z powodu przekroczenia limitu czasu.',
// Builder
'missing_app_yml' => 'Projekt nie zawiera pliku .php-censor.yml (.phpci.yml|phpci.yml) lub projekt jest pusty.',
'build_success' => 'BUDOWANIE ZAKOŃCZONE SUKCESEM',

View file

@ -208,7 +208,6 @@ PHP Censor',
'result' => 'Result',
'ok' => 'OK',
'took_n_seconds' => 'Took %d seconds',
'build_created' => 'Build Created',
'build_started' => 'Build Started',
'build_finished' => 'Build Finished',
'test_message' => 'Message',
@ -314,35 +313,6 @@ PHP Censor',
'not_installed' => 'PHP Censor does not appear to be installed.',
'install_instead' => 'Please install PHP Censor via php-censor:install instead.',
// Poll Command
'poll_github' => 'Poll GitHub to check if we need to start a build.',
'no_token' => 'No GitHub token found',
'finding_projects' => 'Finding projects to poll',
'found_n_projects' => 'Found %d projects',
'last_commit_is' => 'Last commit to GitHub for %s is %s',
'adding_new_build' => 'Last commit is different to database, adding new build.',
'finished_processing_builds' => 'Finished processing builds.',
// Create Admin
'create_admin_user' => 'Create an admin user',
'incorrect_format' => 'Incorrect format',
// Create Build Command
'create_build_project' => 'Create a build for a project',
'project_id_argument' => 'A project ID',
'commit_id_option' => 'Commit ID 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 PHP Censor is set to use a beanstalkd server that does not exist,
or your beanstalkd server has stopped.',
// Run Command
'run_all_pending' => 'Run all pending PHP Censor builds.',
'finding_builds' => 'Finding builds to process',
'found_n_builds' => 'Found %d builds',
'skipping_build' => 'Skipping Build %d - Project build already in progress.',
'marked_as_failed' => 'Build %d marked as failed due to timeout.',
// Builder
'missing_app_yml' => 'This project does not contain a .php-censor.yml (.phpci.yml|phpci.yml) file, or it is empty.',
'build_success' => 'BUILD SUCCESS',

View file

@ -218,7 +218,6 @@ PHP Censor',
'result' => 'Результат',
'ok' => 'OK',
'took_n_seconds' => 'Заняло секунд: %d',
'build_created' => 'Сборка создана',
'build_started' => 'Сборка запущена',
'build_finished' => 'Сборка окончена',
'test_message' => 'Сообщение',
@ -332,32 +331,6 @@ PHP Censor',
'not_installed' => 'PHP Censor не может быть установлен.',
'install_instead' => 'Пожалуйста, установите PHP Censor с помощью команды php-censor:install.',
// Poll Command
'poll_github' => 'Опрос GitHub для проверки запуска сборки.',
'no_token' => 'GitHub токен не найден',
'finding_projects' => 'Поиск проектов для опроса',
'found_n_projects' => 'Найдено проектов: %d',
'last_commit_is' => 'Последний коммит на GitHub для %s - %s',
'adding_new_build' => 'Последний коммит имеет различия с базой данных, создана сборка.',
'finished_processing_builds' => 'Процесс сборки завершен.',
// Create Admin
'create_admin_user' => 'Добавить аккаунт администратора',
'incorrect_format' => 'Неверный формат',
// Create Build Command
'create_build_project' => 'Создать сборку проекта',
'project_id_argument' => 'ID проекта',
'commit_id_option' => 'ID коммита для сборки',
'branch_name_option' => 'Ветка для сборки',
// Run Command
'run_all_pending' => 'Запустить все ожидающие PHP Censor сборки.',
'finding_builds' => 'Поиск сборок для запуска',
'found_n_builds' => 'Найдено сборок: %d',
'skipping_build' => 'Сборка %d пропущена - Сборка проекта уже идет.',
'marked_as_failed' => 'Сборка %d отмечена как неудавшаяся из-за превышения лимита времени.',
// Builder
'missing_app_yml' => 'Этот проект не содержит файла .php-censor.yml (.phpci.yml|phpci.yml), или файл пустой.',
'build_success' => 'СБОРКА УСПЕШНА',

View file

@ -199,7 +199,6 @@ PHP Censor',
'result' => 'Результат',
'ok' => 'OK',
'took_n_seconds' => 'Зайняло %d секунд',
'build_created' => 'Збірка створена',
'build_started' => 'Збірка розпочата',
'build_finished' => 'Збірка завершена',
'test_message' => 'Message',
@ -292,32 +291,6 @@ PHP Censor',
'not_installed' => 'Неможливо встановити PHP Censor.',
'install_instead' => 'Будь ласка, встановіть PHP Censor через команду php-censor:install.',
// Poll Command
'poll_github' => 'Зробити запит до GitHub для перевірки запуску збірки.',
'no_token' => 'GitHub токен не знайдено',
'finding_projects' => 'Пошук проектів для запиту',
'found_n_projects' => 'Знайдено %d проектів',
'last_commit_is' => 'Останній коміт на GitHub для %s - %s',
'adding_new_build' => 'Останній коміт має відмінності із базою даних, створена нова збірка.',
'finished_processing_builds' => 'Завершено обробку збірок.',
// Create Admin
'create_admin_user' => 'Створити аккаунт адміністратора',
'incorrect_format' => 'Невірний формат',
// Create Build Command
'create_build_project' => 'Create a build for a project',
'project_id_argument' => 'A project ID',
'commit_id_option' => 'Commit ID to build',
'branch_name_option' => 'Branch to build',
// Run Command
'run_all_pending' => 'Запустити всі PHP Censor збірки, які очікують.',
'finding_builds' => 'Пошук збірок для обробки',
'found_n_builds' => 'Знайдено %d збірок',
'skipping_build' => 'Збірка %d пропущена - Збірка проекта вже у процесі.',
'marked_as_failed' => 'Збірка %d відмічена як невдала через перевищення ліміту часу.',
// Builder
'missing_app_yml' => 'Цей проект не містить файл .php-censor.yml (.phpci.yml|phpci.yml) або він є порожнім.',
'build_success' => 'ЗБІРКА УСПІШНА',

View file

@ -206,7 +206,6 @@ PHP Censor',
'result' => 'Result',
'ok' => 'OK',
'took_n_seconds' => 'Took %d seconds',
'build_created' => 'Build Created',
'build_started' => 'Build Started',
'build_finished' => 'Build Finished',
'test_message' => 'Message',
@ -307,35 +306,6 @@ PHP Censor',
'not_installed' => 'PHP Censor does not appear to be installed.',
'install_instead' => 'Please install PHP Censor via php-censor:install instead.',
// Poll Command
'poll_github' => 'Poll GitHub to check if we need to start a build.',
'no_token' => 'No GitHub token found',
'finding_projects' => 'Finding projects to poll',
'found_n_projects' => 'Found %d projects',
'last_commit_is' => 'Last commit to GitHub for %s is %s',
'adding_new_build' => 'Last commit is different to database, adding new build.',
'finished_processing_builds' => 'Finished processing builds.',
// Create Admin
'create_admin_user' => 'Create an admin user',
'incorrect_format' => 'Incorrect format',
// Create Build Command
'create_build_project' => 'Create a build for a project',
'project_id_argument' => 'A project ID',
'commit_id_option' => 'Commit ID 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 PHP Censor is set to use a beanstalkd server that does not exist,
or your beanstalkd server has stopped.',
// Run Command
'run_all_pending' => 'Run all pending PHP Censor builds.',
'finding_builds' => 'Finding builds to process',
'found_n_builds' => 'Found %d builds',
'skipping_build' => 'Skipping Build %d - Project build already in progress.',
'marked_as_failed' => 'Build %d marked as failed due to timeout.',
// Builder
'missing_app_yml' => 'This project does not contain a .php-censor.yml (.phpci.yml|phpci.yml) file, or it is empty.',
'build_success' => 'BUILD SUCCESS',

View file

@ -130,7 +130,20 @@ class InstallCommandTest extends \PHPUnit_Framework_TestCase
$this->executeWithoutParam(null, $dialog);
}
public function testDatabaseHostnameConfig()
public function testDatabaseTypeConfig()
{
$dialog = $this->getHelperMock();
// We specified an input value for hostname.
$dialog->expects($this->once())->method('ask')->willReturn('testedvalue');
$this->executeWithoutParam('--db-type', $dialog);
// Check that specified arguments are correctly loaded.
$this->assertEquals('testedvalue', $this->config['b8']['database']['type']);
}
public function testDatabaseHostConfig()
{
$dialog = $this->getHelperMock();
@ -144,6 +157,34 @@ class InstallCommandTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('testedvalue', $this->config['b8']['database']['servers']['write'][0]['host']);
}
public function testDatabaseStringPortConfig()
{
$dialog = $this->getHelperMock();
// We specified an input value for hostname.
$dialog->expects($this->once())->method('ask')->willReturn('testedvalue');
$this->executeWithoutParam('--db-port', $dialog);
// Check that specified arguments are correctly loaded.
$this->assertEquals(0, $this->config['b8']['database']['servers']['read'][0]['port']);
$this->assertEquals(0, $this->config['b8']['database']['servers']['write'][0]['port']);
}
public function testDatabasePortConfig()
{
$dialog = $this->getHelperMock();
// We specified an input value for hostname.
$dialog->expects($this->once())->method('ask')->willReturn('333');
$this->executeWithoutParam('--db-port', $dialog);
// Check that specified arguments are correctly loaded.
$this->assertEquals(333, $this->config['b8']['database']['servers']['read'][0]['port']);
$this->assertEquals(333, $this->config['b8']['database']['servers']['write'][0]['port']);
}
public function testDatabaseNameConfig()
{
$dialog = $this->getHelperMock();

View file

@ -7,8 +7,6 @@
* @link http://www.phptesting.org/
*/
use PHPCensor\Logging\LoggerConfig;
if (!defined('ROOT_DIR')) {
define('ROOT_DIR', dirname(__DIR__) . DIRECTORY_SEPARATOR);
}