Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Commit

Permalink
some clean ups
Browse files Browse the repository at this point in the history
  • Loading branch information
cordoval committed Apr 26, 2014
1 parent 1950f9b commit 12ad7ac
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 45 deletions.
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# IDE
.build_dir
.externalTollBuilders
.settings
.project
.buildpath
/.build_dir
/.externalTollBuilders
/.settings
/.project
/.buildpath

# Dependencies
vendor
/vendor

# Bin
pharcc.phar
jolici.phar
/pharcc.phar
/jolici.phar
14 changes: 7 additions & 7 deletions .pharcc.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: jolici.phar
main: bin/jolici
include:
- src/
- vendor/
- resources/
- src/
- vendor/
- resources/
exclude:
- "/[Tt]ests?/"
- "/docs?/"
- "^vendor/phpunit"
- "^vendor/bin"
- "/[Tt]ests?/"
- "/docs?/"
- "^vendor/phpunit"
- "^vendor/bin"
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
language: php

php:
- 5.4
- 5.5
- hhvm
- 5.4
- 5.5
- hhvm

matrix:
allow_failures:
- php: hhvm
allow_failures:
- php: hhvm


before_script:
- COMPOSER_ROOT_VERSION=dev-master composer --prefer-source --dev install
- COMPOSER_ROOT_VERSION=dev-master composer --prefer-source install

script: phpunit
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# JoliCi

JoliCi is a free and open source Continuous Integration Client written in PHP and propulsed by Docker. It has been written to be easy to use.
JoliCi is a free and open source Continuous Integration Client written in PHP and powered by Docker. It has been written to be easy to use.
Thanks to the use of Docker, all kind of projects can be tested with this CI (not just PHP) : you are completely free.

**This project is still in beta, there may be bugs and missing features**
Expand Down
2 changes: 1 addition & 1 deletion docs/strategies/JoliCiStrategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This strategy is based on a directory structure and Dockerfiles, this is the mos

To create builds the project **MUST** have a `.jolici` directory.

Each subdirectory is then considered as a different build, they **MUST** have a `Dockerfile` which will explained how to build projects and how to run tests.
Each subdirectory is then considered as a different build, they **MUST** have a `Dockerfile` which will explain how to build projects and how to run tests.

`CMD` or `ENTRYPOINT` commands in a `Dockerfile` will describe how to run a build.

Expand Down
6 changes: 3 additions & 3 deletions docs/strategies/TravisCiStrategy.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# TravisCiBuildStrategy

This strategy parse the .travis.yml file at the root of your project to create Dockerfile and run tests.
This strategy parses the .travis.yml file at the root of your project to create a Dockerfile and run tests.

## Language and version support

For the moment only the following language / version list is supported, goal is to support what travis support:
For the moment only the following language / version list is supported, the goal is to support what travis supports:

* php
* 5.3
Expand All @@ -14,4 +14,4 @@ For the moment only the following language / version list is supported, goal is
* 1.9.2
* 1.9.3
* 2.0.0
* 2.1.0
* 2.1.0
1 change: 1 addition & 0 deletions src/Joli/JoliCi/Build.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Build
protected $dockername;

/**
* @param $name
* @param string $directory
*/
public function __construct($name, $directory)
Expand Down
1 change: 1 addition & 0 deletions src/Joli/JoliCi/BuildStrategy/JoliCiBuildStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class JoliCiBuildStrategy implements BuildStrategyInterface

/**
* @param string $buildPath
* @param Filesystem|null $filesystem
*/
public function __construct($buildPath, Filesystem $filesystem = null)
{
Expand Down
9 changes: 6 additions & 3 deletions src/Joli/JoliCi/BuildStrategy/TravisCiBuildStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
namespace Joli\JoliCi\BuildStrategy;

use Joli\JoliCi\Build;
use Joli\JoliCi\Builder\DockerfileBuilder;
use Joli\JoliCi\Filesystem\Filesystem;
use Symfony\Component\Yaml\Yaml;
use Joli\JoliCi\Builder\DockerfileBuilder;


/**
* TravisCi implementation for build
Expand Down Expand Up @@ -68,7 +69,9 @@ class TravisCiBuildStrategy implements BuildStrategyInterface
private $filesystem;

/**
* @param DockerfileBuilder $builder
* @param string $buildPath
* @param Filesystem|null $filesystem
*/
public function __construct(DockerfileBuilder $builder, $buildPath, Filesystem $filesystem = null)
{
Expand Down Expand Up @@ -110,7 +113,7 @@ public function createBuilds($directory)
$buildName = sprintf("%s-%s", $language, $version);
$buildDir = $buildRoot.DIRECTORY_SEPARATOR.$buildName;

//Recursive copy of the pull to this directory
// Recursive copy of the pull to this directory
$this->filesystem->rcopy($directory, $buildDir, true);

$this->builder->setOutputName('Dockerfile');
Expand All @@ -120,7 +123,7 @@ public function createBuilds($directory)

$builds[] = new Build($buildName, $buildDir);
} catch (\Twig_Error_Loader $e) {
//Do nothing, template does not exist so language-php is not supported by JoliCI (emit a warning ?)
// Do nothing, template does not exist so language-php is not supported by JoliCI (emit a warning ?)
}
}

Expand Down
4 changes: 1 addition & 3 deletions src/Joli/JoliCi/Command/RunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@

use Joli\JoliCi\Container;
use Joli\JoliCi\Filesystem\Filesystem;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;


class RunCommand extends Command
{
/**
Expand Down Expand Up @@ -72,7 +70,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$filesystem->remove($build->getDirectory());
}

//Remove parent folder
// Remove parent folder
if (count($builds) > 0) {
rmdir(dirname($build->getDirectory()));
}
Expand Down
3 changes: 0 additions & 3 deletions src/Joli/JoliCi/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@

use Docker\Docker;
use Docker\Http\Client;

use Joli\JoliCi\Log\SimpleFormatter;
use Joli\JoliCi\BuildStrategy\TravisCiBuildStrategy;
use Joli\JoliCi\BuildStrategy\JoliCiBuildStrategy;
use Joli\JoliCi\Builder\DockerfileBuilder;

use Monolog\Logger;
use Monolog\Handler\StreamHandler;

use TwigGenerator\Builder\Generator;

class Container
Expand Down
15 changes: 7 additions & 8 deletions src/Joli/JoliCi/Executor.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@

namespace Joli\JoliCi;

use Monolog\Logger;

use Docker\Docker;
use Docker\Context\Context;
use Docker\Image;
use Docker\Container as DockerContainer;
use Monolog\Logger;

class Executor
{
Expand Down Expand Up @@ -60,16 +59,16 @@ public function __construct(Logger $logger, Docker $docker, $usecache = true, $q
/**
* Run build command
*
* @param unknown $directory Directory where the project to build is
* @param unknown $dockername Name of the docker image to create
* @param string $directory Directory where the project to build is
* @param string $dockername Name of the docker image to create
*
* @return boolean Return true on build success, false otherwise
*/
public function runBuild($directory, $dockername)
{
$logger = $this->logger;

//Run build
// Run build
$context = new Context($directory);
$response = $this->docker->build($context, $dockername, $this->quietBuild, $this->usecache, false, false);
$error = false;
Expand All @@ -95,7 +94,7 @@ public function runBuild($directory, $dockername)
$staticId = $output['id'];
}

//Only get progress message (but current, total, and start size may be available under progressDetail)
// Only get progress message (but current, total, and start size may be available under progressDetail)
if (isset($output['progress'])) {
$message .= " ".$output['progress'];
}
Expand Down Expand Up @@ -130,7 +129,7 @@ public function runTest($dockername, $cmdOverride = array())
{
$logger = $this->logger;

//Execute test
// Execute test
$config = array();
$image = new Image();
$image->setRepository($dockername);
Expand All @@ -144,7 +143,7 @@ public function runTest($dockername, $cmdOverride = array())
$container = new DockerContainer($config);
$container->setImage($image);

//Find better way to pass timeout
// Find better way to pass timeout
$currentTimeout = ini_get('default_socket_timeout');
ini_set('default_socket_timeout', $this->timeout);

Expand Down
1 change: 1 addition & 0 deletions src/Joli/JoliCi/Filesystem/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function rcopy($originFile, $targetFile, $override = false)
* @see \Symfony\Component\Filesystem\Filesystem::copy()
* @param string $originFile
* @param string $targetFile
* @param Boolean $override
*/
public function copy($originFile, $targetFile, $override = false)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Joli\JoliCi\BuildStrategy;

use org\bovigo\vfs\vfsStream;
use Joli\JoliCi\BuildStrategy\TravisCiBuildStrategy;
use Joli\JoliCi\Builder\DockerfileBuilder;
use Joli\JoliCi\BuildStrategy\TravisCiBuildStrategy;

class TravisCiBuildStrategyTest extends \PHPUnit_Framework_TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Joli/JoliCi/ExecutorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function testRunTest()
$this->assertEquals("test", $config["Image"]);
}

public function testRunTestWithCmdOverride()
public function testRunTestWithCmdOverride()
{
$containerManager = $this->getMock('\Docker\Container\ContainerManager', array('run', 'attach', 'wait'));

Expand Down

0 comments on commit 12ad7ac

Please sign in to comment.