From 5b1847c9df911eaa9c26659bdb1d82cd6cec4a16 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Mon, 4 May 2015 00:28:52 +0200 Subject: [PATCH] added Makefile for docker based build --- .gitignore | 8 +++++++- Makefile | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 3d48d74..45574d3 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ Thumbs.db # composer vendor dir /vendor +/composer.lock # composer itself is not needed composer.phar @@ -27,4 +28,9 @@ phpunit.phar /phpunit.xml # local tests configuration -/tests/data/config.local.php \ No newline at end of file +/tests/data/config.local.php + +/tests/runtime +/tests/docker +/tests/dockerids + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..16372e7 --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ + +# default versions to test against +# these can be overridden by setting the environment variables in the shell +PHP_VERSION=php-5.6.8 +YII_VERSION=dev-master + +# ensure all the configuration variables above are in environment of the shell commands below +export + +help: + @echo "make test - run phpunit tests using a docker environment" +# @echo "make clean - stop docker and remove container" + +test: docker-php + composer require "yiisoft/yii2:${YII_VERSION}" --prefer-dist + composer install --prefer-dist + docker run --rm=true -v $(shell pwd):/opt/test yiitest/php:${PHP_VERSION} phpunit --verbose --color + +docker-php: dockerfiles + cd tests/docker/php && sh build.sh + +dockerfiles: + test -d tests/docker || git clone https://github.com/cebe/jenkins-test-docker tests/docker + cd tests/docker && git checkout -- . && git pull + mkdir -p tests/dockerids +