PK J#CV
composer.locknu W+A {
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "e667456612577e11231803ebba91b43b",
"packages": [
{
"name": "codegyre/robo-docker",
"version": "0.1.0",
"source": {
"type": "git",
"url": "https://github.com/Codegyre/robo-docker.git",
"reference": "69aec8b828890e86d5c74bb53c74045ce5ca2f70"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Codegyre/robo-docker/zipball/69aec8b828890e86d5c74bb53c74045ce5ca2f70",
"reference": "69aec8b828890e86d5c74bb53c74045ce5ca2f70",
"shasum": ""
},
"type": "library",
"autoload": {
"psr-4": {
"Codegyre\\RoboDocker\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Davert",
"email": "davert.php@resend.cc"
}
],
"description": "Docker Tasks for Robo Task Runner",
"time": "2014-09-26 23:58:29"
},
{
"name": "symfony/yaml",
"version": "v2.5.4",
"target-dir": "Symfony/Component/Yaml",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml.git",
"reference": "01a7695bcfb013d0a15c6757e15aae120342986f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Yaml/zipball/01a7695bcfb013d0a15c6757e15aae120342986f",
"reference": "01a7695bcfb013d0a15c6757e15aae120342986f",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.5-dev"
}
},
"autoload": {
"psr-0": {
"Symfony\\Component\\Yaml\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "Symfony Yaml Component",
"homepage": "http://symfony.com",
"time": "2014-08-31 03:22:04"
}
],
"packages-dev": [
],
"aliases": [
],
"minimum-stability": "stable",
"stability-flags": [
],
"prefer-stable": false,
"platform": [
],
"platform-dev": [
]
}
PK J#CV\D D LICENSEnu W+A The MIT License (MIT)
Copyright (c) 2014 Codegyre developers team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
PK J#CV!/ VERSIONnu W+A 0.1.0PK J#CVQx: : RoboFile.phpnu W+A taskChangelog()
->version($this->getVersion())
->change($change)
->run();
}
public function release()
{
$this->say("Releasing");
$this->taskGitStack()
->add('CHANGELOG.md')
->commit('updated')
->push()
->run();
$this->taskGitHubRelease($this->version())
->uri('Codegyre/RoboCI')
->run();
}
protected function getVersion()
{
return trim(file_get_contents('VERSION'));
}
}PK J#CVi
composer.jsonnu W+A {
"name": "codegyre/robo-ci",
"description": "Travis CI cli runner",
"license": "MIT",
"authors": [
{
"name": "Davert",
"email": "davert.php@resend.cc"
}
],
"autoload":{
"psr-4":{
"Codegyre\\RoboCI\\":"src"
}
},
"require": {
"symfony/yaml": "~2.0",
"codegyre/robo-docker": "*"
}
}PK J#CVb0 0 CHANGELOG.mdnu W+A # Changelog
#### 0.1.0
* initial *2014-09-27*
PK J#CV recipes/postgresql/link.shnu W+A socat TCP4-LISTEN:5432,fork,reuseaddr TCP4:postgresql:5432 &
sudo mkdir /var/run/postgresql
sudo chown travis /var/run/postgresql
socat UNIX-LISTEN:/var/run/postgresql/.s.PGSQL.5432,fork,reuseaddr TCP4:postgresql:3306 &
psql -c "CREATE USER postgres WITH PASSWORD '' ;"
PK J#CVw
recipes/postgresql/Dockerfilenu W+A FROM postgresPK J#CV8G~ ~ recipes/php/Dockerfilenu W+A FROM davert/roboci-base
RUN echo '/usr/bin/Xvfb :99 -ac -screen 0 1024x768x24 &' > /etc/init.d/xvfb
RUN chef-solo -o php::multi,composer -j travis.json
RUN curl -s http://getcomposer.org/installer | php
RUN mv composer.phar /usr/bin/composer
USER travis
ENV PATH $PATH:/home/travis/.phpenv/bin
RUN ["/bin/bash", "-l", "-c", "eval \"$(phpenv init -)\""]
RUN phpenv rehash 2>/dev/nullPK J#CV#@w w recipes/rabbitmq/link.shnu W+A socat TCP4-LISTEN:5672,fork,reuseaddr TCP4:rabbitmq:5672 &
socat TCP4-LISTEN:15672,fork,reuseaddr TCP4:rabbitmq:15672 &PK J#CV(N N recipes/rabbitmq/Dockerfilenu W+A FROM frodenas/rabbitmq
ENV RABBITMQ_USERNAME guest
ENV RABBITMQ_PASSWORD guestPK J#CV[&; ; recipes/mongodb/link.shnu W+A socat TCP4-LISTEN:27017,fork,reuseaddr TCP4:mongodb:27017 &PK J#CVXI
recipes/mongodb/Dockerfilenu W+A FROM mongoPK J#CVcn n recipes/base/travis.jsonnu W+A {"travis_build_environment":{"user":"travis","group":"travis","home":"\/home\/travis\/","update_hosts":false}}PK J#CV& recipes/base/Dockerfilenu W+A FROM ubuntu:12.04
RUN apt-get update && apt-get install -y cron && apt-get install -y curl sudo git rsync build-essential wget ruby1.9.1 rubygems1.9.1 python-software-properties && curl -L https://www.opscode.com/chef/install.sh | bash && wget -O - https://github.com/travis-ci/travis-cookbooks/archive/master.tar.gz | tar -xz && mkdir -p /var/chef/cookbooks && cp -a travis-cookbooks-master/ci_environment/* /var/chef/cookbooks
RUN adduser travis --disabled-password --gecos ""
RUN mkdir /home/travis/builds
ADD travis.json travis.json
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN chmod 777 /tmp
RUN echo 'travis ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoersPK J#CVK7 7 recipes/redis/link.shnu W+A socat TCP4-LISTEN:6379,fork,reuseaddr TCP4:redis:6379 &PK J#CV@C
recipes/redis/Dockerfilenu W+A FROM redisPK J#CV~m% % recipes/mysql/link.shnu W+A socat TCP4-LISTEN:3306,fork,reuseaddr TCP4:mysql:3306 &
sudo mkdir /var/run/mysqld
sudo chown travis /var/run/mysqld
socat UNIX-LISTEN:/var/run/mysqld/mysqld.sock,fork,reuseaddr TCP4:mysql:3306 &
mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO travis@$(hostname --ip-address) IDENTIFIED BY ''"PK J#CV"J" recipes/mysql/Dockerfilenu W+A FROM centurylink/mysqlPK J#CV
.gitignorenu W+A composer.phar
vendor/
.idea
PK J#CVz README.mdnu W+A # RoboCI
RoboCI is virtualized environment runner for Continuous Integration servers.
RoboCI is aimed to **run Travis CI builds locally** inside [Docker](http://docker.io) containers as well creating custom build setup.
## RoboCI is used to:
* create virtualized environments with Docker.
* run acceptance, functional, unit, integration tests in isolated containers.
* run Travis CI builds locally or on CI server.
* debug builds inside containers
## Requirements
Requires [Docker](http://docker.io) and [Robo PHP Task Runner](http://robo.li) to be installed.
## Installation
Use Composer
```
{
"require-dev": {
"codegyre/robo": "*",
"codegyre/robo-ci": "@dev"
}
}
```
Create `RoboFile.php` in the root of your project (if it is not already there), by simply running `robo`.
Attach composer autoloader to include `Codegyre\RoboCI` into your RoboFile:
``` php
printTaskInfo("Getting all robo_* containers");
$res = $this->taskExec('docker ps -a | grep robo_')->printed(false)->run();
if (!$res->wasSuccessful()) {
$this->printTaskInfo("No containers matched");
return;
}
$containerLines = explode("\n", $res->getMessage());
foreach ($containerLines as $container) {
$data = explode(' ', $container);
$id = trim(reset($data));
if (!$id) continue;
$this->containers[] = $id;
}
$this->printTaskInfo("Containers are:
* Whether a offset exists
* @link http://php.net/manual/en/arrayaccess.offsetexists.php
* @param mixed $offset
* An offset to check for. *
* @return boolean true on success or false on failure. * *
* The return value will be casted to boolean if non-boolean was returned.
*/
public function offsetExists($offset)
{
return isset($this->config[$offset]);
}
/**
* (PHP 5 >= 5.0.0)
* Offset to retrieve
* @link http://php.net/manual/en/arrayaccess.offsetget.php
* @param mixed $offset
* The offset to retrieve. *
* @return mixed Can return all value types. */ public function offsetGet($offset) { return isset($this->config[$offset]) ? $this->config[$offset] : null; } /** * (PHP 5 >= 5.0.0)* The offset to assign the value to. *
* @param mixed $value* The value to set. *
* @return void */ public function offsetSet($offset, $value) { // TODO: Implement offsetSet() method. } /** * (PHP 5 >= 5.0.0)* The offset to unset. *
* @return void */ public function offsetUnset($offset) { // TODO: Implement offsetUnset() method. } }PK J#CV' src/ConfigParser/RoboEnv.phpnu W+A config = Yaml::parse($file); } function services() { return isset($this->config['services']) ? $this->config['services'] : []; } }PK J#CVK9En n src/Command/CI.phpnu W+A buildImage(); $runner->runServices(); $res = $runner->getContainerRunner() ->exec($runner->getRunCommand()) ->args($args) ->run(); $runner->stopServices(); !$res->getExitCode() ? $this->yell('BUILD SUCCESSFUL') : $this->say("