Skip to content

Commit e4263ee

Browse files
committed
added Makefile for docker based test
1 parent a4835e3 commit e4263ee

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,9 @@ composer.phar
2424
phpunit.phar
2525
# local phpunit config
2626
/phpunit.xml
27+
28+
/tests/runtime
29+
/tests/data/config.local.php
30+
/tests/docker
31+
/tests/dockerids
32+

Makefile

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
# default versions to test against
3+
# these can be overridden by setting the environment variables in the shell
4+
PHP_VERSION=php-5.6.8
5+
YII_VERSION=dev-master
6+
7+
# ensure all the configuration variables above are in environment of the shell commands below
8+
export
9+
10+
help:
11+
@echo "make test - run phpunit tests using a docker environment"
12+
# @echo "make clean - stop docker and remove container"
13+
14+
test: docker-php
15+
composer require "yiisoft/yii2:${YII_VERSION}" --prefer-dist
16+
composer install --prefer-dist
17+
docker run --rm=true -v $(shell pwd):/opt/test yiitest/php:${PHP_VERSION} phpunit --verbose --color
18+
19+
docker-php: dockerfiles
20+
cd tests/docker/php && sh build.sh
21+
22+
dockerfiles:
23+
test -d tests/docker || git clone https://github.com/cebe/jenkins-test-docker tests/docker
24+
cd tests/docker && git checkout -- . && git pull
25+
mkdir -p tests/dockerids
26+

0 commit comments

Comments
 (0)