From 74f3b145f207ac7ac74a6850f949596f11aad2c5 Mon Sep 17 00:00:00 2001 From: "a.cianfarani" Date: Wed, 5 Jun 2013 16:48:01 +0200 Subject: [PATCH 1/7] Merge upstream/master --- LICENSE.md | 0 PHPCI/Application.php | 0 PHPCI/BuildFactory.php | 0 PHPCI/Builder.php | 0 PHPCI/Command/GenerateCommand.php | 0 PHPCI/Command/InstallCommand.php | 0 PHPCI/Command/RunCommand.php | 0 PHPCI/Controller.php | 0 PHPCI/Controller/BitbucketController.php | 0 PHPCI/Controller/BuildController.php | 0 PHPCI/Controller/BuildStatusController.php | 0 PHPCI/Controller/GithubController.php | 0 PHPCI/Controller/IndexController.php | 0 PHPCI/Controller/ProjectController.php | 0 PHPCI/Controller/SessionController.php | 0 PHPCI/Controller/UserController.php | 0 PHPCI/Helper/User.php | 0 PHPCI/Model/Base/BuildBase.php | 0 PHPCI/Model/Base/ProjectBase.php | 0 PHPCI/Model/Base/UserBase.php | 0 PHPCI/Model/Build.php | 0 PHPCI/Model/Build/BitbucketBuild.php | 0 PHPCI/Model/Build/GithubBuild.php | 0 PHPCI/Model/Build/LocalBuild.php | 0 PHPCI/Model/Build/RemoteGitBuild.php | 0 PHPCI/Model/Project.php | 0 PHPCI/Model/User.php | 0 PHPCI/Plugin.php | 0 PHPCI/Plugin/CleanBuild.php | 0 PHPCI/Plugin/Composer.php | 0 PHPCI/Plugin/CopyBuild.php | 0 PHPCI/Plugin/Env.php | 0 PHPCI/Plugin/Mysql.php | 0 PHPCI/Plugin/PackageBuild.php | 0 PHPCI/Plugin/Pgsql.php | 0 PHPCI/Plugin/PhpCodeSniffer.php | 0 PHPCI/Plugin/PhpCpd.php | 0 PHPCI/Plugin/PhpCsFixer.php | 0 PHPCI/Plugin/PhpMessDetector.php | 0 PHPCI/Plugin/PhpSpec.php | 0 PHPCI/Plugin/PhpUnit.php | 0 PHPCI/Plugin/Shell.php | 0 PHPCI/Store/Base/BuildStoreBase.php | 0 PHPCI/Store/Base/ProjectStoreBase.php | 0 PHPCI/Store/Base/UserStoreBase.php | 0 PHPCI/Store/BuildStore.php | 0 PHPCI/Store/ProjectStore.php | 0 PHPCI/Store/UserStore.php | 0 PHPCI/View/Build/view.phtml | 0 PHPCI/View/BuildsTable.phtml | 0 PHPCI/View/Index/index.phtml | 0 PHPCI/View/Project/view.phtml | 0 PHPCI/View/ProjectForm.phtml | 0 PHPCI/View/Session/login.phtml | 0 PHPCI/View/User/index.phtml | 0 PHPCI/View/UserForm.phtml | 0 PHPCI/View/layout.phtml | 0 PHPCI/build/.gitignore | 0 README.md | 0 Tests/PHPCI/Plugin/PHPUnitTest.php | 0 assets/css/phpci.css | 0 assets/img/build-failed.png | Bin assets/img/build-ok.png | Bin assets/img/glyphicons-halflings-white.png | Bin assets/img/glyphicons-halflings.png | Bin assets/img/icon-build-failed.png | Bin assets/img/icon-build-ok.png | Bin assets/img/icon-build-pending.png | Bin assets/img/icon-build-running.png | Bin assets/js/phpci.js | 0 bootstrap.php | 0 build/.gitignore | 0 composer.json | 0 index.php | 0 phpci.yml | 0 75 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 LICENSE.md mode change 100644 => 100755 PHPCI/Application.php mode change 100644 => 100755 PHPCI/BuildFactory.php mode change 100644 => 100755 PHPCI/Builder.php mode change 100644 => 100755 PHPCI/Command/GenerateCommand.php mode change 100644 => 100755 PHPCI/Command/InstallCommand.php mode change 100644 => 100755 PHPCI/Command/RunCommand.php mode change 100644 => 100755 PHPCI/Controller.php mode change 100644 => 100755 PHPCI/Controller/BitbucketController.php mode change 100644 => 100755 PHPCI/Controller/BuildController.php mode change 100644 => 100755 PHPCI/Controller/BuildStatusController.php mode change 100644 => 100755 PHPCI/Controller/GithubController.php mode change 100644 => 100755 PHPCI/Controller/IndexController.php mode change 100644 => 100755 PHPCI/Controller/ProjectController.php mode change 100644 => 100755 PHPCI/Controller/SessionController.php mode change 100644 => 100755 PHPCI/Controller/UserController.php mode change 100644 => 100755 PHPCI/Helper/User.php mode change 100644 => 100755 PHPCI/Model/Base/BuildBase.php mode change 100644 => 100755 PHPCI/Model/Base/ProjectBase.php mode change 100644 => 100755 PHPCI/Model/Base/UserBase.php mode change 100644 => 100755 PHPCI/Model/Build.php mode change 100644 => 100755 PHPCI/Model/Build/BitbucketBuild.php mode change 100644 => 100755 PHPCI/Model/Build/GithubBuild.php mode change 100644 => 100755 PHPCI/Model/Build/LocalBuild.php mode change 100644 => 100755 PHPCI/Model/Build/RemoteGitBuild.php mode change 100644 => 100755 PHPCI/Model/Project.php mode change 100644 => 100755 PHPCI/Model/User.php mode change 100644 => 100755 PHPCI/Plugin.php mode change 100644 => 100755 PHPCI/Plugin/CleanBuild.php mode change 100644 => 100755 PHPCI/Plugin/Composer.php mode change 100644 => 100755 PHPCI/Plugin/CopyBuild.php mode change 100644 => 100755 PHPCI/Plugin/Env.php mode change 100644 => 100755 PHPCI/Plugin/Mysql.php mode change 100644 => 100755 PHPCI/Plugin/PackageBuild.php mode change 100644 => 100755 PHPCI/Plugin/Pgsql.php mode change 100644 => 100755 PHPCI/Plugin/PhpCodeSniffer.php mode change 100644 => 100755 PHPCI/Plugin/PhpCpd.php mode change 100644 => 100755 PHPCI/Plugin/PhpCsFixer.php mode change 100644 => 100755 PHPCI/Plugin/PhpMessDetector.php mode change 100644 => 100755 PHPCI/Plugin/PhpSpec.php mode change 100644 => 100755 PHPCI/Plugin/PhpUnit.php mode change 100644 => 100755 PHPCI/Plugin/Shell.php mode change 100644 => 100755 PHPCI/Store/Base/BuildStoreBase.php mode change 100644 => 100755 PHPCI/Store/Base/ProjectStoreBase.php mode change 100644 => 100755 PHPCI/Store/Base/UserStoreBase.php mode change 100644 => 100755 PHPCI/Store/BuildStore.php mode change 100644 => 100755 PHPCI/Store/ProjectStore.php mode change 100644 => 100755 PHPCI/Store/UserStore.php mode change 100644 => 100755 PHPCI/View/Build/view.phtml mode change 100644 => 100755 PHPCI/View/BuildsTable.phtml mode change 100644 => 100755 PHPCI/View/Index/index.phtml mode change 100644 => 100755 PHPCI/View/Project/view.phtml mode change 100644 => 100755 PHPCI/View/ProjectForm.phtml mode change 100644 => 100755 PHPCI/View/Session/login.phtml mode change 100644 => 100755 PHPCI/View/User/index.phtml mode change 100644 => 100755 PHPCI/View/UserForm.phtml mode change 100644 => 100755 PHPCI/View/layout.phtml mode change 100644 => 100755 PHPCI/build/.gitignore mode change 100644 => 100755 README.md mode change 100644 => 100755 Tests/PHPCI/Plugin/PHPUnitTest.php mode change 100644 => 100755 assets/css/phpci.css mode change 100644 => 100755 assets/img/build-failed.png mode change 100644 => 100755 assets/img/build-ok.png mode change 100644 => 100755 assets/img/glyphicons-halflings-white.png mode change 100644 => 100755 assets/img/glyphicons-halflings.png mode change 100644 => 100755 assets/img/icon-build-failed.png mode change 100644 => 100755 assets/img/icon-build-ok.png mode change 100644 => 100755 assets/img/icon-build-pending.png mode change 100644 => 100755 assets/img/icon-build-running.png mode change 100644 => 100755 assets/js/phpci.js mode change 100644 => 100755 bootstrap.php mode change 100644 => 100755 build/.gitignore mode change 100644 => 100755 composer.json mode change 100644 => 100755 index.php mode change 100644 => 100755 phpci.yml diff --git a/LICENSE.md b/LICENSE.md old mode 100644 new mode 100755 diff --git a/PHPCI/Application.php b/PHPCI/Application.php old mode 100644 new mode 100755 diff --git a/PHPCI/BuildFactory.php b/PHPCI/BuildFactory.php old mode 100644 new mode 100755 diff --git a/PHPCI/Builder.php b/PHPCI/Builder.php old mode 100644 new mode 100755 diff --git a/PHPCI/Command/GenerateCommand.php b/PHPCI/Command/GenerateCommand.php old mode 100644 new mode 100755 diff --git a/PHPCI/Command/InstallCommand.php b/PHPCI/Command/InstallCommand.php old mode 100644 new mode 100755 diff --git a/PHPCI/Command/RunCommand.php b/PHPCI/Command/RunCommand.php old mode 100644 new mode 100755 diff --git a/PHPCI/Controller.php b/PHPCI/Controller.php old mode 100644 new mode 100755 diff --git a/PHPCI/Controller/BitbucketController.php b/PHPCI/Controller/BitbucketController.php old mode 100644 new mode 100755 diff --git a/PHPCI/Controller/BuildController.php b/PHPCI/Controller/BuildController.php old mode 100644 new mode 100755 diff --git a/PHPCI/Controller/BuildStatusController.php b/PHPCI/Controller/BuildStatusController.php old mode 100644 new mode 100755 diff --git a/PHPCI/Controller/GithubController.php b/PHPCI/Controller/GithubController.php old mode 100644 new mode 100755 diff --git a/PHPCI/Controller/IndexController.php b/PHPCI/Controller/IndexController.php old mode 100644 new mode 100755 diff --git a/PHPCI/Controller/ProjectController.php b/PHPCI/Controller/ProjectController.php old mode 100644 new mode 100755 diff --git a/PHPCI/Controller/SessionController.php b/PHPCI/Controller/SessionController.php old mode 100644 new mode 100755 diff --git a/PHPCI/Controller/UserController.php b/PHPCI/Controller/UserController.php old mode 100644 new mode 100755 diff --git a/PHPCI/Helper/User.php b/PHPCI/Helper/User.php old mode 100644 new mode 100755 diff --git a/PHPCI/Model/Base/BuildBase.php b/PHPCI/Model/Base/BuildBase.php old mode 100644 new mode 100755 diff --git a/PHPCI/Model/Base/ProjectBase.php b/PHPCI/Model/Base/ProjectBase.php old mode 100644 new mode 100755 diff --git a/PHPCI/Model/Base/UserBase.php b/PHPCI/Model/Base/UserBase.php old mode 100644 new mode 100755 diff --git a/PHPCI/Model/Build.php b/PHPCI/Model/Build.php old mode 100644 new mode 100755 diff --git a/PHPCI/Model/Build/BitbucketBuild.php b/PHPCI/Model/Build/BitbucketBuild.php old mode 100644 new mode 100755 diff --git a/PHPCI/Model/Build/GithubBuild.php b/PHPCI/Model/Build/GithubBuild.php old mode 100644 new mode 100755 diff --git a/PHPCI/Model/Build/LocalBuild.php b/PHPCI/Model/Build/LocalBuild.php old mode 100644 new mode 100755 diff --git a/PHPCI/Model/Build/RemoteGitBuild.php b/PHPCI/Model/Build/RemoteGitBuild.php old mode 100644 new mode 100755 diff --git a/PHPCI/Model/Project.php b/PHPCI/Model/Project.php old mode 100644 new mode 100755 diff --git a/PHPCI/Model/User.php b/PHPCI/Model/User.php old mode 100644 new mode 100755 diff --git a/PHPCI/Plugin.php b/PHPCI/Plugin.php old mode 100644 new mode 100755 diff --git a/PHPCI/Plugin/CleanBuild.php b/PHPCI/Plugin/CleanBuild.php old mode 100644 new mode 100755 diff --git a/PHPCI/Plugin/Composer.php b/PHPCI/Plugin/Composer.php old mode 100644 new mode 100755 diff --git a/PHPCI/Plugin/CopyBuild.php b/PHPCI/Plugin/CopyBuild.php old mode 100644 new mode 100755 diff --git a/PHPCI/Plugin/Env.php b/PHPCI/Plugin/Env.php old mode 100644 new mode 100755 diff --git a/PHPCI/Plugin/Mysql.php b/PHPCI/Plugin/Mysql.php old mode 100644 new mode 100755 diff --git a/PHPCI/Plugin/PackageBuild.php b/PHPCI/Plugin/PackageBuild.php old mode 100644 new mode 100755 diff --git a/PHPCI/Plugin/Pgsql.php b/PHPCI/Plugin/Pgsql.php old mode 100644 new mode 100755 diff --git a/PHPCI/Plugin/PhpCodeSniffer.php b/PHPCI/Plugin/PhpCodeSniffer.php old mode 100644 new mode 100755 diff --git a/PHPCI/Plugin/PhpCpd.php b/PHPCI/Plugin/PhpCpd.php old mode 100644 new mode 100755 diff --git a/PHPCI/Plugin/PhpCsFixer.php b/PHPCI/Plugin/PhpCsFixer.php old mode 100644 new mode 100755 diff --git a/PHPCI/Plugin/PhpMessDetector.php b/PHPCI/Plugin/PhpMessDetector.php old mode 100644 new mode 100755 diff --git a/PHPCI/Plugin/PhpSpec.php b/PHPCI/Plugin/PhpSpec.php old mode 100644 new mode 100755 diff --git a/PHPCI/Plugin/PhpUnit.php b/PHPCI/Plugin/PhpUnit.php old mode 100644 new mode 100755 diff --git a/PHPCI/Plugin/Shell.php b/PHPCI/Plugin/Shell.php old mode 100644 new mode 100755 diff --git a/PHPCI/Store/Base/BuildStoreBase.php b/PHPCI/Store/Base/BuildStoreBase.php old mode 100644 new mode 100755 diff --git a/PHPCI/Store/Base/ProjectStoreBase.php b/PHPCI/Store/Base/ProjectStoreBase.php old mode 100644 new mode 100755 diff --git a/PHPCI/Store/Base/UserStoreBase.php b/PHPCI/Store/Base/UserStoreBase.php old mode 100644 new mode 100755 diff --git a/PHPCI/Store/BuildStore.php b/PHPCI/Store/BuildStore.php old mode 100644 new mode 100755 diff --git a/PHPCI/Store/ProjectStore.php b/PHPCI/Store/ProjectStore.php old mode 100644 new mode 100755 diff --git a/PHPCI/Store/UserStore.php b/PHPCI/Store/UserStore.php old mode 100644 new mode 100755 diff --git a/PHPCI/View/Build/view.phtml b/PHPCI/View/Build/view.phtml old mode 100644 new mode 100755 diff --git a/PHPCI/View/BuildsTable.phtml b/PHPCI/View/BuildsTable.phtml old mode 100644 new mode 100755 diff --git a/PHPCI/View/Index/index.phtml b/PHPCI/View/Index/index.phtml old mode 100644 new mode 100755 diff --git a/PHPCI/View/Project/view.phtml b/PHPCI/View/Project/view.phtml old mode 100644 new mode 100755 diff --git a/PHPCI/View/ProjectForm.phtml b/PHPCI/View/ProjectForm.phtml old mode 100644 new mode 100755 diff --git a/PHPCI/View/Session/login.phtml b/PHPCI/View/Session/login.phtml old mode 100644 new mode 100755 diff --git a/PHPCI/View/User/index.phtml b/PHPCI/View/User/index.phtml old mode 100644 new mode 100755 diff --git a/PHPCI/View/UserForm.phtml b/PHPCI/View/UserForm.phtml old mode 100644 new mode 100755 diff --git a/PHPCI/View/layout.phtml b/PHPCI/View/layout.phtml old mode 100644 new mode 100755 diff --git a/PHPCI/build/.gitignore b/PHPCI/build/.gitignore old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/Tests/PHPCI/Plugin/PHPUnitTest.php b/Tests/PHPCI/Plugin/PHPUnitTest.php old mode 100644 new mode 100755 diff --git a/assets/css/phpci.css b/assets/css/phpci.css old mode 100644 new mode 100755 diff --git a/assets/img/build-failed.png b/assets/img/build-failed.png old mode 100644 new mode 100755 diff --git a/assets/img/build-ok.png b/assets/img/build-ok.png old mode 100644 new mode 100755 diff --git a/assets/img/glyphicons-halflings-white.png b/assets/img/glyphicons-halflings-white.png old mode 100644 new mode 100755 diff --git a/assets/img/glyphicons-halflings.png b/assets/img/glyphicons-halflings.png old mode 100644 new mode 100755 diff --git a/assets/img/icon-build-failed.png b/assets/img/icon-build-failed.png old mode 100644 new mode 100755 diff --git a/assets/img/icon-build-ok.png b/assets/img/icon-build-ok.png old mode 100644 new mode 100755 diff --git a/assets/img/icon-build-pending.png b/assets/img/icon-build-pending.png old mode 100644 new mode 100755 diff --git a/assets/img/icon-build-running.png b/assets/img/icon-build-running.png old mode 100644 new mode 100755 diff --git a/assets/js/phpci.js b/assets/js/phpci.js old mode 100644 new mode 100755 diff --git a/bootstrap.php b/bootstrap.php old mode 100644 new mode 100755 diff --git a/build/.gitignore b/build/.gitignore old mode 100644 new mode 100755 diff --git a/composer.json b/composer.json old mode 100644 new mode 100755 diff --git a/index.php b/index.php old mode 100644 new mode 100755 diff --git a/phpci.yml b/phpci.yml old mode 100644 new mode 100755 From 2bfd2266630e7670575553279e9cb8ac8f5f5949 Mon Sep 17 00:00:00 2001 From: "a.cianfarani" Date: Fri, 2 Aug 2013 12:02:44 +0200 Subject: [PATCH 2/7] Implemented Atoum plugin as a 'native' plugin: - allow atoum bin to be called directly into PHPCI and not only in the current project tested (changed -d option), - added plugin in the phpci's composer.json, - modify execute method of the plugin because atoum always return 0 even if errors are catched, --- PHPCI/Plugin/Atoum.php | 20 +++++++++++++++----- composer.json | 3 ++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/PHPCI/Plugin/Atoum.php b/PHPCI/Plugin/Atoum.php index a97fa00a..1e2aeca3 100644 --- a/PHPCI/Plugin/Atoum.php +++ b/PHPCI/Plugin/Atoum.php @@ -7,7 +7,6 @@ class Atoum implements \PHPCI\Plugin private $args; private $config; private $directory; - private $executable; public function __construct(\PHPCI\Builder $phpci, array $options = array()) { @@ -17,7 +16,7 @@ class Atoum implements \PHPCI\Plugin $this->executable = $options['executable']; } else { - $this->executable = './vendor/bin/atoum'; + $this->executable = PHPCI_BIN_DIR.'atoum'; } if (isset($options['args'])) { @@ -35,7 +34,7 @@ class Atoum implements \PHPCI\Plugin public function execute() { - $cmd = $this->phpci->buildPath . DIRECTORY_SEPARATOR . $this->executable; + $cmd = $this->executable; if ($this->args !== null) { $cmd .= " {$this->args}"; @@ -44,8 +43,19 @@ class Atoum implements \PHPCI\Plugin $cmd .= " -c '{$this->config}'"; } if ($this->directory !== null) { - $cmd .= " -d '{$this->directory}'"; + $dirPath = $this->phpci->buildPath . DIRECTORY_SEPARATOR . $this->directory; + $cmd .= " -d '{$dirPath}'"; } - return $this->phpci->executeCommand($cmd); + + $output = ''; + $status = true; + exec($cmd, $output); + + if (!empty($output) && count(preg_grep("/error/i",$output)) > 0) { + $status = false; + $this->phpci->log($output, ' '); + } + + return $status; } } diff --git a/composer.json b/composer.json index a4424830..ae912b8d 100755 --- a/composer.json +++ b/composer.json @@ -33,6 +33,7 @@ "symfony/yaml" : "2.2.x-dev", "symfony/console" : "2.2.*", "fabpot/php-cs-fixer" : "0.3.*@dev", - "swiftmailer/swiftmailer" : "v5.0.0" + "swiftmailer/swiftmailer" : "v5.0.0", + "atoum/atoum":"*" } } From 97d279cabdf4a9e668ba4b534e6c7a9a9ac060b7 Mon Sep 17 00:00:00 2001 From: "a.cianfarani" Date: Fri, 2 Aug 2013 12:12:17 +0200 Subject: [PATCH 3/7] Cleaned coding style --- PHPCI/Plugin/Atoum.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PHPCI/Plugin/Atoum.php b/PHPCI/Plugin/Atoum.php index 1e2aeca3..06e3e23e 100644 --- a/PHPCI/Plugin/Atoum.php +++ b/PHPCI/Plugin/Atoum.php @@ -14,8 +14,7 @@ class Atoum implements \PHPCI\Plugin if (isset($options['executable'])) { $this->executable = $options['executable']; - } - else { + } else { $this->executable = PHPCI_BIN_DIR.'atoum'; } @@ -51,7 +50,7 @@ class Atoum implements \PHPCI\Plugin $status = true; exec($cmd, $output); - if (!empty($output) && count(preg_grep("/error/i",$output)) > 0) { + if (!empty($output) && count(preg_grep("/error/i", $output)) > 0) { $status = false; $this->phpci->log($output, ' '); } From db42fb4224b7f57326d841bcf2c448345406643c Mon Sep 17 00:00:00 2001 From: "a.cianfarani" Date: Wed, 21 Aug 2013 15:37:23 +0200 Subject: [PATCH 4/7] restored chmod --- LICENSE.md | 0 PHPCI/Application.php | 0 PHPCI/BuildFactory.php | 0 PHPCI/Builder.php | 0 PHPCI/Command/GenerateCommand.php | 0 PHPCI/Command/InstallCommand.php | 0 PHPCI/Command/RunCommand.php | 0 PHPCI/Controller.php | 0 PHPCI/Controller/BitbucketController.php | 0 PHPCI/Controller/BuildController.php | 0 PHPCI/Controller/BuildStatusController.php | 0 PHPCI/Controller/GithubController.php | 0 PHPCI/Controller/IndexController.php | 0 PHPCI/Controller/ProjectController.php | 0 PHPCI/Controller/SessionController.php | 0 PHPCI/Controller/UserController.php | 0 PHPCI/Helper/User.php | 0 PHPCI/Model/Base/BuildBase.php | 0 PHPCI/Model/Base/ProjectBase.php | 0 PHPCI/Model/Base/UserBase.php | 0 PHPCI/Model/Build.php | 0 PHPCI/Model/Build/BitbucketBuild.php | 0 PHPCI/Model/Build/GithubBuild.php | 0 PHPCI/Model/Build/LocalBuild.php | 0 PHPCI/Model/Build/RemoteGitBuild.php | 0 PHPCI/Model/Project.php | 0 PHPCI/Model/User.php | 0 PHPCI/Plugin.php | 0 PHPCI/Plugin/CleanBuild.php | 0 PHPCI/Plugin/Composer.php | 0 PHPCI/Plugin/CopyBuild.php | 0 PHPCI/Plugin/Env.php | 0 PHPCI/Plugin/Mysql.php | 0 PHPCI/Plugin/PackageBuild.php | 0 PHPCI/Plugin/Pgsql.php | 0 PHPCI/Plugin/PhpCodeSniffer.php | 0 PHPCI/Plugin/PhpCpd.php | 0 PHPCI/Plugin/PhpCsFixer.php | 0 PHPCI/Plugin/PhpMessDetector.php | 0 PHPCI/Plugin/PhpSpec.php | 0 PHPCI/Plugin/PhpUnit.php | 0 PHPCI/Plugin/Shell.php | 0 PHPCI/Store/Base/BuildStoreBase.php | 0 PHPCI/Store/Base/ProjectStoreBase.php | 0 PHPCI/Store/Base/UserStoreBase.php | 0 PHPCI/Store/BuildStore.php | 0 PHPCI/Store/ProjectStore.php | 0 PHPCI/Store/UserStore.php | 0 PHPCI/View/Build/view.phtml | 0 PHPCI/View/BuildsTable.phtml | 0 PHPCI/View/Index/index.phtml | 0 PHPCI/View/Project/view.phtml | 0 PHPCI/View/ProjectForm.phtml | 0 PHPCI/View/Session/login.phtml | 0 PHPCI/View/User/index.phtml | 0 PHPCI/View/UserForm.phtml | 0 PHPCI/View/layout.phtml | 0 PHPCI/build/.gitignore | 0 README.md | 0 Tests/PHPCI/Plugin/PHPUnitTest.php | 0 bootstrap.php | 0 build/.gitignore | 0 composer.json | 0 console | 0 daemonise | 0 phpci.yml | 0 public/assets/css/phpci.css | 0 public/assets/img/build-failed.png | Bin public/assets/img/build-ok.png | Bin public/assets/img/glyphicons-halflings-white.png | Bin public/assets/img/glyphicons-halflings.png | Bin public/assets/img/icon-build-failed.png | Bin public/assets/img/icon-build-ok.png | Bin public/assets/img/icon-build-pending.png | Bin public/assets/img/icon-build-running.png | Bin public/assets/js/phpci.js | 0 public/index.php | 0 77 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 LICENSE.md mode change 100755 => 100644 PHPCI/Application.php mode change 100755 => 100644 PHPCI/BuildFactory.php mode change 100755 => 100644 PHPCI/Builder.php mode change 100755 => 100644 PHPCI/Command/GenerateCommand.php mode change 100755 => 100644 PHPCI/Command/InstallCommand.php mode change 100755 => 100644 PHPCI/Command/RunCommand.php mode change 100755 => 100644 PHPCI/Controller.php mode change 100755 => 100644 PHPCI/Controller/BitbucketController.php mode change 100755 => 100644 PHPCI/Controller/BuildController.php mode change 100755 => 100644 PHPCI/Controller/BuildStatusController.php mode change 100755 => 100644 PHPCI/Controller/GithubController.php mode change 100755 => 100644 PHPCI/Controller/IndexController.php mode change 100755 => 100644 PHPCI/Controller/ProjectController.php mode change 100755 => 100644 PHPCI/Controller/SessionController.php mode change 100755 => 100644 PHPCI/Controller/UserController.php mode change 100755 => 100644 PHPCI/Helper/User.php mode change 100755 => 100644 PHPCI/Model/Base/BuildBase.php mode change 100755 => 100644 PHPCI/Model/Base/ProjectBase.php mode change 100755 => 100644 PHPCI/Model/Base/UserBase.php mode change 100755 => 100644 PHPCI/Model/Build.php mode change 100755 => 100644 PHPCI/Model/Build/BitbucketBuild.php mode change 100755 => 100644 PHPCI/Model/Build/GithubBuild.php mode change 100755 => 100644 PHPCI/Model/Build/LocalBuild.php mode change 100755 => 100644 PHPCI/Model/Build/RemoteGitBuild.php mode change 100755 => 100644 PHPCI/Model/Project.php mode change 100755 => 100644 PHPCI/Model/User.php mode change 100755 => 100644 PHPCI/Plugin.php mode change 100755 => 100644 PHPCI/Plugin/CleanBuild.php mode change 100755 => 100644 PHPCI/Plugin/Composer.php mode change 100755 => 100644 PHPCI/Plugin/CopyBuild.php mode change 100755 => 100644 PHPCI/Plugin/Env.php mode change 100755 => 100644 PHPCI/Plugin/Mysql.php mode change 100755 => 100644 PHPCI/Plugin/PackageBuild.php mode change 100755 => 100644 PHPCI/Plugin/Pgsql.php mode change 100755 => 100644 PHPCI/Plugin/PhpCodeSniffer.php mode change 100755 => 100644 PHPCI/Plugin/PhpCpd.php mode change 100755 => 100644 PHPCI/Plugin/PhpCsFixer.php mode change 100755 => 100644 PHPCI/Plugin/PhpMessDetector.php mode change 100755 => 100644 PHPCI/Plugin/PhpSpec.php mode change 100755 => 100644 PHPCI/Plugin/PhpUnit.php mode change 100755 => 100644 PHPCI/Plugin/Shell.php mode change 100755 => 100644 PHPCI/Store/Base/BuildStoreBase.php mode change 100755 => 100644 PHPCI/Store/Base/ProjectStoreBase.php mode change 100755 => 100644 PHPCI/Store/Base/UserStoreBase.php mode change 100755 => 100644 PHPCI/Store/BuildStore.php mode change 100755 => 100644 PHPCI/Store/ProjectStore.php mode change 100755 => 100644 PHPCI/Store/UserStore.php mode change 100755 => 100644 PHPCI/View/Build/view.phtml mode change 100755 => 100644 PHPCI/View/BuildsTable.phtml mode change 100755 => 100644 PHPCI/View/Index/index.phtml mode change 100755 => 100644 PHPCI/View/Project/view.phtml mode change 100755 => 100644 PHPCI/View/ProjectForm.phtml mode change 100755 => 100644 PHPCI/View/Session/login.phtml mode change 100755 => 100644 PHPCI/View/User/index.phtml mode change 100755 => 100644 PHPCI/View/UserForm.phtml mode change 100755 => 100644 PHPCI/View/layout.phtml mode change 100755 => 100644 PHPCI/build/.gitignore mode change 100755 => 100644 README.md mode change 100755 => 100644 Tests/PHPCI/Plugin/PHPUnitTest.php mode change 100755 => 100644 bootstrap.php mode change 100755 => 100644 build/.gitignore mode change 100755 => 100644 composer.json mode change 100755 => 100644 console mode change 100755 => 100644 daemonise mode change 100755 => 100644 phpci.yml mode change 100755 => 100644 public/assets/css/phpci.css mode change 100755 => 100644 public/assets/img/build-failed.png mode change 100755 => 100644 public/assets/img/build-ok.png mode change 100755 => 100644 public/assets/img/glyphicons-halflings-white.png mode change 100755 => 100644 public/assets/img/glyphicons-halflings.png mode change 100755 => 100644 public/assets/img/icon-build-failed.png mode change 100755 => 100644 public/assets/img/icon-build-ok.png mode change 100755 => 100644 public/assets/img/icon-build-pending.png mode change 100755 => 100644 public/assets/img/icon-build-running.png mode change 100755 => 100644 public/assets/js/phpci.js mode change 100755 => 100644 public/index.php diff --git a/LICENSE.md b/LICENSE.md old mode 100755 new mode 100644 diff --git a/PHPCI/Application.php b/PHPCI/Application.php old mode 100755 new mode 100644 diff --git a/PHPCI/BuildFactory.php b/PHPCI/BuildFactory.php old mode 100755 new mode 100644 diff --git a/PHPCI/Builder.php b/PHPCI/Builder.php old mode 100755 new mode 100644 diff --git a/PHPCI/Command/GenerateCommand.php b/PHPCI/Command/GenerateCommand.php old mode 100755 new mode 100644 diff --git a/PHPCI/Command/InstallCommand.php b/PHPCI/Command/InstallCommand.php old mode 100755 new mode 100644 diff --git a/PHPCI/Command/RunCommand.php b/PHPCI/Command/RunCommand.php old mode 100755 new mode 100644 diff --git a/PHPCI/Controller.php b/PHPCI/Controller.php old mode 100755 new mode 100644 diff --git a/PHPCI/Controller/BitbucketController.php b/PHPCI/Controller/BitbucketController.php old mode 100755 new mode 100644 diff --git a/PHPCI/Controller/BuildController.php b/PHPCI/Controller/BuildController.php old mode 100755 new mode 100644 diff --git a/PHPCI/Controller/BuildStatusController.php b/PHPCI/Controller/BuildStatusController.php old mode 100755 new mode 100644 diff --git a/PHPCI/Controller/GithubController.php b/PHPCI/Controller/GithubController.php old mode 100755 new mode 100644 diff --git a/PHPCI/Controller/IndexController.php b/PHPCI/Controller/IndexController.php old mode 100755 new mode 100644 diff --git a/PHPCI/Controller/ProjectController.php b/PHPCI/Controller/ProjectController.php old mode 100755 new mode 100644 diff --git a/PHPCI/Controller/SessionController.php b/PHPCI/Controller/SessionController.php old mode 100755 new mode 100644 diff --git a/PHPCI/Controller/UserController.php b/PHPCI/Controller/UserController.php old mode 100755 new mode 100644 diff --git a/PHPCI/Helper/User.php b/PHPCI/Helper/User.php old mode 100755 new mode 100644 diff --git a/PHPCI/Model/Base/BuildBase.php b/PHPCI/Model/Base/BuildBase.php old mode 100755 new mode 100644 diff --git a/PHPCI/Model/Base/ProjectBase.php b/PHPCI/Model/Base/ProjectBase.php old mode 100755 new mode 100644 diff --git a/PHPCI/Model/Base/UserBase.php b/PHPCI/Model/Base/UserBase.php old mode 100755 new mode 100644 diff --git a/PHPCI/Model/Build.php b/PHPCI/Model/Build.php old mode 100755 new mode 100644 diff --git a/PHPCI/Model/Build/BitbucketBuild.php b/PHPCI/Model/Build/BitbucketBuild.php old mode 100755 new mode 100644 diff --git a/PHPCI/Model/Build/GithubBuild.php b/PHPCI/Model/Build/GithubBuild.php old mode 100755 new mode 100644 diff --git a/PHPCI/Model/Build/LocalBuild.php b/PHPCI/Model/Build/LocalBuild.php old mode 100755 new mode 100644 diff --git a/PHPCI/Model/Build/RemoteGitBuild.php b/PHPCI/Model/Build/RemoteGitBuild.php old mode 100755 new mode 100644 diff --git a/PHPCI/Model/Project.php b/PHPCI/Model/Project.php old mode 100755 new mode 100644 diff --git a/PHPCI/Model/User.php b/PHPCI/Model/User.php old mode 100755 new mode 100644 diff --git a/PHPCI/Plugin.php b/PHPCI/Plugin.php old mode 100755 new mode 100644 diff --git a/PHPCI/Plugin/CleanBuild.php b/PHPCI/Plugin/CleanBuild.php old mode 100755 new mode 100644 diff --git a/PHPCI/Plugin/Composer.php b/PHPCI/Plugin/Composer.php old mode 100755 new mode 100644 diff --git a/PHPCI/Plugin/CopyBuild.php b/PHPCI/Plugin/CopyBuild.php old mode 100755 new mode 100644 diff --git a/PHPCI/Plugin/Env.php b/PHPCI/Plugin/Env.php old mode 100755 new mode 100644 diff --git a/PHPCI/Plugin/Mysql.php b/PHPCI/Plugin/Mysql.php old mode 100755 new mode 100644 diff --git a/PHPCI/Plugin/PackageBuild.php b/PHPCI/Plugin/PackageBuild.php old mode 100755 new mode 100644 diff --git a/PHPCI/Plugin/Pgsql.php b/PHPCI/Plugin/Pgsql.php old mode 100755 new mode 100644 diff --git a/PHPCI/Plugin/PhpCodeSniffer.php b/PHPCI/Plugin/PhpCodeSniffer.php old mode 100755 new mode 100644 diff --git a/PHPCI/Plugin/PhpCpd.php b/PHPCI/Plugin/PhpCpd.php old mode 100755 new mode 100644 diff --git a/PHPCI/Plugin/PhpCsFixer.php b/PHPCI/Plugin/PhpCsFixer.php old mode 100755 new mode 100644 diff --git a/PHPCI/Plugin/PhpMessDetector.php b/PHPCI/Plugin/PhpMessDetector.php old mode 100755 new mode 100644 diff --git a/PHPCI/Plugin/PhpSpec.php b/PHPCI/Plugin/PhpSpec.php old mode 100755 new mode 100644 diff --git a/PHPCI/Plugin/PhpUnit.php b/PHPCI/Plugin/PhpUnit.php old mode 100755 new mode 100644 diff --git a/PHPCI/Plugin/Shell.php b/PHPCI/Plugin/Shell.php old mode 100755 new mode 100644 diff --git a/PHPCI/Store/Base/BuildStoreBase.php b/PHPCI/Store/Base/BuildStoreBase.php old mode 100755 new mode 100644 diff --git a/PHPCI/Store/Base/ProjectStoreBase.php b/PHPCI/Store/Base/ProjectStoreBase.php old mode 100755 new mode 100644 diff --git a/PHPCI/Store/Base/UserStoreBase.php b/PHPCI/Store/Base/UserStoreBase.php old mode 100755 new mode 100644 diff --git a/PHPCI/Store/BuildStore.php b/PHPCI/Store/BuildStore.php old mode 100755 new mode 100644 diff --git a/PHPCI/Store/ProjectStore.php b/PHPCI/Store/ProjectStore.php old mode 100755 new mode 100644 diff --git a/PHPCI/Store/UserStore.php b/PHPCI/Store/UserStore.php old mode 100755 new mode 100644 diff --git a/PHPCI/View/Build/view.phtml b/PHPCI/View/Build/view.phtml old mode 100755 new mode 100644 diff --git a/PHPCI/View/BuildsTable.phtml b/PHPCI/View/BuildsTable.phtml old mode 100755 new mode 100644 diff --git a/PHPCI/View/Index/index.phtml b/PHPCI/View/Index/index.phtml old mode 100755 new mode 100644 diff --git a/PHPCI/View/Project/view.phtml b/PHPCI/View/Project/view.phtml old mode 100755 new mode 100644 diff --git a/PHPCI/View/ProjectForm.phtml b/PHPCI/View/ProjectForm.phtml old mode 100755 new mode 100644 diff --git a/PHPCI/View/Session/login.phtml b/PHPCI/View/Session/login.phtml old mode 100755 new mode 100644 diff --git a/PHPCI/View/User/index.phtml b/PHPCI/View/User/index.phtml old mode 100755 new mode 100644 diff --git a/PHPCI/View/UserForm.phtml b/PHPCI/View/UserForm.phtml old mode 100755 new mode 100644 diff --git a/PHPCI/View/layout.phtml b/PHPCI/View/layout.phtml old mode 100755 new mode 100644 diff --git a/PHPCI/build/.gitignore b/PHPCI/build/.gitignore old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/Tests/PHPCI/Plugin/PHPUnitTest.php b/Tests/PHPCI/Plugin/PHPUnitTest.php old mode 100755 new mode 100644 diff --git a/bootstrap.php b/bootstrap.php old mode 100755 new mode 100644 diff --git a/build/.gitignore b/build/.gitignore old mode 100755 new mode 100644 diff --git a/composer.json b/composer.json old mode 100755 new mode 100644 diff --git a/console b/console old mode 100755 new mode 100644 diff --git a/daemonise b/daemonise old mode 100755 new mode 100644 diff --git a/phpci.yml b/phpci.yml old mode 100755 new mode 100644 diff --git a/public/assets/css/phpci.css b/public/assets/css/phpci.css old mode 100755 new mode 100644 diff --git a/public/assets/img/build-failed.png b/public/assets/img/build-failed.png old mode 100755 new mode 100644 diff --git a/public/assets/img/build-ok.png b/public/assets/img/build-ok.png old mode 100755 new mode 100644 diff --git a/public/assets/img/glyphicons-halflings-white.png b/public/assets/img/glyphicons-halflings-white.png old mode 100755 new mode 100644 diff --git a/public/assets/img/glyphicons-halflings.png b/public/assets/img/glyphicons-halflings.png old mode 100755 new mode 100644 diff --git a/public/assets/img/icon-build-failed.png b/public/assets/img/icon-build-failed.png old mode 100755 new mode 100644 diff --git a/public/assets/img/icon-build-ok.png b/public/assets/img/icon-build-ok.png old mode 100755 new mode 100644 diff --git a/public/assets/img/icon-build-pending.png b/public/assets/img/icon-build-pending.png old mode 100755 new mode 100644 diff --git a/public/assets/img/icon-build-running.png b/public/assets/img/icon-build-running.png old mode 100755 new mode 100644 diff --git a/public/assets/js/phpci.js b/public/assets/js/phpci.js old mode 100755 new mode 100644 diff --git a/public/index.php b/public/index.php old mode 100755 new mode 100644 From f1fab01fd8704e56d84cf11bbd530edf08113ae1 Mon Sep 17 00:00:00 2001 From: "a.cianfarani" Date: Wed, 21 Aug 2013 15:39:13 +0200 Subject: [PATCH 5/7] restored chmod --- console | 0 daemonise | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 console mode change 100644 => 100755 daemonise diff --git a/console b/console old mode 100644 new mode 100755 diff --git a/daemonise b/daemonise old mode 100644 new mode 100755 From 47be59ae4619b23779def8e27e2eb97c9f3bf2b5 Mon Sep 17 00:00:00 2001 From: "a.cianfarani" Date: Fri, 23 Aug 2013 16:05:12 +0200 Subject: [PATCH 6/7] Added Gitlab support --- PHPCI/BuildFactory.php | 3 ++ PHPCI/Controller/ProjectController.php | 32 ++++++++++++++++- PHPCI/Model/Base/ProjectBase.php | 39 ++++++++++++++++++++ PHPCI/Model/Build/GitlabBuild.php | 50 ++++++++++++++++++++++++++ 4 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 PHPCI/Model/Build/GitlabBuild.php diff --git a/PHPCI/BuildFactory.php b/PHPCI/BuildFactory.php index c4479b05..689e5604 100644 --- a/PHPCI/BuildFactory.php +++ b/PHPCI/BuildFactory.php @@ -40,6 +40,9 @@ class BuildFactory case 'bitbucket': $type = 'BitbucketBuild'; break; + case 'gitlab': + $type = 'GitlabBuild'; + break; } $type = '\\PHPCI\\Model\\Build\\' . $type; diff --git a/PHPCI/Controller/ProjectController.php b/PHPCI/Controller/ProjectController.php index 3406cbd6..e343ac88 100644 --- a/PHPCI/Controller/ProjectController.php +++ b/PHPCI/Controller/ProjectController.php @@ -158,6 +158,16 @@ class ProjectController extends \PHPCI\Controller } $values = $form->getValues(); + + if ($values['type'] == "gitlab") { + preg_match('`^(.*)@(.*):(.*)/(.*)\.git`',$values['reference'],$matches); + $info = array(); + $info["user"] = $matches[1]; + $info["domain"] = $matches[2]; + $values['access_information'] = serialize($info); + $values['reference'] = $matches[3]."/".$matches[4]; + } + $values['git_key'] = $values['key']; $project = new Project(); @@ -213,8 +223,13 @@ class ProjectController extends \PHPCI\Controller } else { $values = $project->getDataArray(); $values['key'] = $values['git_key']; + if ($values['type'] == "gitlab") { + $accessInfo = $project->getAccessInformation(); + $values['reference'] = $accessInfo["user"].'@'.$accessInfo["domain"].':' . $project->getReference().".git"; + } } + $form = $this->projectForm($values, 'edit/' . $projectId); if ($method != 'POST' || ($method == 'POST' && !$form->validate())) { @@ -230,6 +245,15 @@ class ProjectController extends \PHPCI\Controller $values = $form->getValues(); $values['git_key'] = $values['key']; + if ($values['type'] == "gitlab") { + preg_match('`^(.*)@(.*):(.*)/(.*)\.git`',$values['reference'],$matches); + $info = array(); + $info["user"] = $matches[1]; + $info["domain"] = $matches[2]; + $values['access_information'] = serialize($info); + $values['reference'] = $matches[3]."/".$matches[4]; + } + $project->setValues($values); $project = $this->_projectStore->save($project); @@ -253,13 +277,14 @@ class ProjectController extends \PHPCI\Controller 'choose' => 'Select repository type...', 'github' => 'Github', 'bitbucket' => 'Bitbucket', + 'gitlab' => 'Gitlab', 'remote' => 'Remote URL', 'local' => 'Local Path' ); $field = new Form\Element\Select('type'); $field->setRequired(true); - $field->setPattern('^(github|bitbucket|remote|local)'); + $field->setPattern('^(github|bitbucket|gitlab|remote|local)'); $field->setOptions($options); $field->setLabel('Where is your project hosted?'); $field->setClass('form-control'); @@ -289,6 +314,11 @@ class ProjectController extends \PHPCI\Controller throw new \Exception('The path you specified does not exist.'); } break; + case 'gitlab': + if (!preg_match('`^(.*)@(.*):(.*)/(.*)\.git`', $val)) { + throw new \Exception('GitLab Repository name must be in the format "user@domain.tld:owner/repo.git".'); + } + break; case 'github': case 'bitbucket': if (!preg_match('/^[a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-\.]+$/', $val)) { diff --git a/PHPCI/Model/Base/ProjectBase.php b/PHPCI/Model/Base/ProjectBase.php index c9d577af..4e8b1e38 100644 --- a/PHPCI/Model/Base/ProjectBase.php +++ b/PHPCI/Model/Base/ProjectBase.php @@ -34,6 +34,7 @@ class ProjectBase extends Model protected $data = array( 'id' => null, 'title' => null, + 'access_information' => null, 'reference' => null, 'git_key' => null, 'type' => null, @@ -49,6 +50,7 @@ class ProjectBase extends Model 'reference' => 'getReference', 'git_key' => 'getGitKey', 'type' => 'getType', + 'access_information' => 'getAccessInformation', 'token' => 'getToken', ); @@ -61,6 +63,7 @@ class ProjectBase extends Model 'reference' => 'setReference', 'git_key' => 'setGitKey', 'type' => 'setType', + 'access_information' => 'setAccessInformation', 'token' => 'setToken', ); @@ -82,6 +85,10 @@ class ProjectBase extends Model 'type' => 'varchar', 'length' => '250', ), + 'access_information' => array( + 'type' => 'varchar', + 'length' => '250', + ), 'git_key' => array( 'type' => 'text', 'length' => '', @@ -150,6 +157,19 @@ class ProjectBase extends Model return $rtn; } + /** + * Get the value of Domain / domain. + * + * @return string + */ + public function getAccessInformation() + { + $rtn = unserialize($this->data['access_information']); + + + return $rtn; + } + /** * Get the value of GitKey / git_key. * @@ -246,6 +266,25 @@ class ProjectBase extends Model $this->_setModified('reference'); } + /** + * Set the value of Domain / domain. + * + * Must not be null. + * @param $value string + */ + public function setAccessInformation($value) + { + $this->_validateNotNull('AccessInformation', $value); + $this->_validateString('AccessInformation', $value); + if ($this->data['access_information'] == $value) { + return; + } + + $this->data['access_information'] = $value; + + $this->_setModified('access_information'); + } + /** * Set the value of GitKey / git_key. * diff --git a/PHPCI/Model/Build/GitlabBuild.php b/PHPCI/Model/Build/GitlabBuild.php new file mode 100644 index 00000000..9f456b0a --- /dev/null +++ b/PHPCI/Model/Build/GitlabBuild.php @@ -0,0 +1,50 @@ + +* @package PHPCI +* @subpackage Core +*/ +class GitlabBuild extends RemoteGitBuild +{ + + /** + * Get link to commit from another source (i.e. Github) + */ + public function getCommitLink() + { + return 'http://'.$this->getProject()->getAccessInformation()["domain"].'/' . $this->getProject()->getReference() . '/commit/' . $this->getCommitId(); + } + + /** + * Get link to branch from another source (i.e. Github) + */ + public function getBranchLink() + { + return 'http://'.$this->getProject()->getAccessInformation()["domain"].'/' . $this->getProject()->getReference() . '/tree/' . $this->getBranch(); + } + + /** + * Get the URL to be used to clone this remote repository. + */ + protected function getCloneUrl() + { + $key = trim($this->getProject()->getGitKey()); + + if (!empty($key)) { + return $this->getProject()->getAccessInformation()["user"].'@'.$this->getProject()->getAccessInformation()["domain"].':' . $this->getProject()->getReference() . '.git'; + } + } +} From 3e0f5d793c3d48df363eb54640171e7592f6261b Mon Sep 17 00:00:00 2001 From: "a.cianfarani" Date: Fri, 23 Aug 2013 18:12:42 +0200 Subject: [PATCH 7/7] Allow atoum to be called from the tested project if executable option is set. Improve errors catching --- PHPCI/Plugin/Atoum.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/PHPCI/Plugin/Atoum.php b/PHPCI/Plugin/Atoum.php index 06e3e23e..54783b07 100644 --- a/PHPCI/Plugin/Atoum.php +++ b/PHPCI/Plugin/Atoum.php @@ -13,7 +13,7 @@ class Atoum implements \PHPCI\Plugin $this->phpci = $phpci; if (isset($options['executable'])) { - $this->executable = $options['executable']; + $this->executable = $this->phpci->buildPath . DIRECTORY_SEPARATOR.$options['executable']; } else { $this->executable = PHPCI_BIN_DIR.'atoum'; } @@ -50,11 +50,15 @@ class Atoum implements \PHPCI\Plugin $status = true; exec($cmd, $output); - if (!empty($output) && count(preg_grep("/error/i", $output)) > 0) { + if (count(preg_grep("/Success \(/", $output)) == 0 ) { $status = false; $this->phpci->log($output, ' '); } - + if (count($output) == 0) { + $status = false; + $this->phpci->log("No test have been performed!", ' '); + } + return $status; } }