您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # default versions to test against
  2. # these can be overridden by setting the environment variables in the shell
  3. PHP_VERSION=php-5.6.8
  4. YII_VERSION=dev-master
  5. PGSQL_VERSION=latest
  6. # ensure all the configuration variables above are in environment of the shell commands below
  7. export
  8. help:
  9. @echo "make test - run phpunit tests using a docker environment"
  10. @echo "make inspect - connect to the postrges docker container using psql"
  11. @echo "make clean - stop docker and remove container"
  12. test: docker-php docker-pgsql adjust-config
  13. composer require "yiisoft/yii2:${YII_VERSION}" --prefer-dist
  14. composer install --prefer-dist
  15. docker run --rm=true -v $(shell pwd):/var/lib/postgresql/data --link $(shell cat tests/dockerids/pgsql):postgres postgres:${PGSQL_VERSION} sh -c 'psql -h postgres -U postgres -c "CREATE DATABASE yiitest;"; psql -h postgres -U postgres yiitest < /var/lib/postgresql/data/tests/data/pgsql.sql'
  16. docker run --rm=true -v $(shell pwd):/opt/test --link $(shell cat tests/dockerids/pgsql):postgres yiitest/php:${PHP_VERSION} phpunit --verbose --color
  17. adjust-config:
  18. echo "<?php \$$config['databases']['pgsql']['dsn'] = 'pgsql:host=postgres;port=5432;dbname=yiitest'; \$$config['databases']['pgsql']['fixture'] = null;" > tests/data/config.local.php
  19. docker-pgsql: dockerfiles
  20. docker pull postgres:${PGSQL_VERSION}
  21. docker run -d -P postgres:${PGSQL_VERSION} > tests/dockerids/pgsql
  22. sleep 2
  23. docker-php: dockerfiles
  24. cd tests/docker/php && sh build.sh
  25. dockerfiles:
  26. test -d tests/docker || git clone https://github.com/cebe/jenkins-test-docker tests/docker
  27. cd tests/docker && git checkout -- . && git pull
  28. mkdir -p tests/dockerids
  29. inspect:
  30. docker run -it --rm=true --link $(shell cat tests/dockerids/pgsql):postgres postgres:${PGSQL_VERSION} sh -c 'exec psql -h postgres -U postgres yiitest'
  31. clean:
  32. docker stop $(shell cat tests/dockerids/pgsql)
  33. docker rm $(shell cat tests/dockerids/pgsql)
  34. rm tests/dockerids/pgsql