forked from yiisoft/yii2-redis
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
37 lines (28 loc) · 1.29 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# default versions to test against
# these can be overridden by setting the environment variables in the shell
REDIS_VERSION=3.0.0
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 adjust-config
#composer require "yiisoft/yii2:${YII_VERSION}" --prefer-dist
#composer install --prefer-dist
docker run --rm=true -v $(shell pwd):/opt/test --link $(shell cat tests/dockerids/redis):redis yiitest/php:${PHP_VERSION} phpunit --verbose --color
adjust-config:
echo "<?php \$$config['databases']['redis']['port'] = 6379; \$$config['databases']['redis']['hostname'] = 'redis';" > tests/data/config.local.php
docker: build-docker
docker run -d -P yiitest/redis:${REDIS_VERSION} > tests/dockerids/redis
build-docker:
test -d tests/docker || git clone https://github.com/cebe/jenkins-test-docker tests/docker
cd tests/docker && git checkout -- . && git pull
cd tests/docker/php && sh build.sh
cd tests/docker/redis && sh build.sh
mkdir -p tests/dockerids
clean:
docker stop $(shell cat tests/dockerids/redis)
docker rm $(shell cat tests/dockerids/redis)
rm tests/dockerids/redis