-
Notifications
You must be signed in to change notification settings - Fork 50
Feature/docker for testing #308
base: master
Are you sure you want to change the base?
Feature/docker for testing #308
Conversation
322ce33
to
b9d9673
Compare
@TomHAnderson I like that idea, I'll have a look on it later on ! Thanks a lot! |
Before you approve this, if you choose, see @Ocramius comment on the linked doctrine PR. |
If you plan to use docker in the examples, then make sure that the project eats its own dogfood and has a pipeline entry (in CI) that uses the advertised docker setup for testing too. It is extremely painful for users to jump into a project and find out-of-sync startup scripts and such 😱 |
b097cf9
to
857298a
Compare
This has been rewritten to a minimal Docker footprint |
2af4d27
to
a6b1272
Compare
Includes a fix to a unit test which changed order. |
@Ocramius was right, as usual, so I added docker-compose to travis testing. I had to use a script because I didn't know how to escape a pipe to run all the commands on the same command line. Docker is php:latest so all 7.2 tests also test Docker with the same dependencies as the test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this changes you can simplify the environment, speeding up tests, and making it more flexible.
You can even use docker configuration for multiple PHP versions using environment variables in travis-ci.
A contributor can easily start tests with one single command:
docker-compose run --rm php
docker/Dockerfile
Outdated
@@ -0,0 +1,11 @@ | |||
FROM php:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use an alpine image to speed up tests, something like this:
ARG PHP_VERSION=7.2
FROM php:${PHP_VERSION}-alpine
RUN apk add --no-cache \
autoconf \
make \
g++
RUN pecl install mongodb && docker-php-ext-enable mongodb
RUN set -o pipefail && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN echo -e '#!/bin/sh' >> /usr/local/bin/entrypoint.sh \
&& echo -e 'while ! nc -z ${MONGO_HOST:-mongo} ${MONGO_PORT:-9000}; do sleep 1; done' >> /usr/local/bin/entrypoint.sh \
&& echo -e 'exec "$@"' >> /usr/local/bin/entrypoint.sh \
&& chmod +x /usr/local/bin/entrypoint.sh
WORKDIR /docker
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["./vendor/bin/phpunit"]
You can specify a build argument to say which image to build.
I also added an entry-point to wait mongodb service to be up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obviously you should change code where mongodb host is localhost
, using environment variables $MONGO_HOST
and $MONGO_PORT
.travis.yml
Outdated
|
||
before_install: | ||
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi | ||
- if [[ $DOCKER == 'true' ]]; then docker-compose up -d; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this
.travis.yml
Outdated
@@ -85,6 +90,7 @@ install: | |||
script: | |||
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi | |||
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi | |||
- if [[ $DOCKER == 'true' ]]; then docker exec -it $(docker ps -f name=zfapigilitydoctrine_php_1 | awk '{print $1;}' | tail -n 1) bash /docker/.travis.docker; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can directly run:
docker-compose run --rm php
with the Docker file in my previous comment
@@ -0,0 +1,15 @@ | |||
version: "3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docker-compose cam be changed with:
version: "3"
services:
php:
build:
context: .
args:
- PHP_VERSION=${PHP_VERSION:-7.2}
dockerfile: docker/Dockerfile
depends_on:
- mongo
volumes:
- ./:/docker
mongo:
image: mongo:latest
You can optionally pass PHP_VERSION
as environment variable in .travis.yml
, using it for different PHP versions
docker/connect
Outdated
@@ -0,0 +1 @@ | |||
docker exec -it $(docker ps -f name=zfapigilitydoctrine_php_1 | awk '{print $1;}' | tail -n 1) bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With previous changes, you don't need this
.travis.docker
Outdated
@@ -0,0 +1,3 @@ | |||
cd /docker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With previous changes, you don't need this anymore
Tested failed unit tests in docker fail the build tested with #310 |
593e7f5
to
c7b4d02
Compare
Starting with @thomasvargiu suggestions I've engineered the tests to run Docker for every test. You can compose a docker container with
All travis tests use the current testing version of PHP in the Docker tests. |
volumes: | ||
- ./:/docker | ||
environment: | ||
- MONGO_HOST=mongo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the default one, you can avoid these environment variables, because you can override it in travis.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running locally the environment variables are correct. The "default" ones are localhost
/27017
. We cannot move these to .travis.yml
only because the local Docker needs them too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally this Docker configuration is correct for the docker-compose and the current project. Moving the docker connect information to environment variables means we're encouraging the user to setup their own hardware to run the repository which is fine if they don't want to use Docker.
test/config/ODM/local.php
Outdated
@@ -8,8 +8,8 @@ | |||
'doctrine' => [ | |||
'connection' => [ | |||
'odm_default' => [ | |||
'server' => 'localhost', | |||
'port' => '27017', | |||
'server' => (getenv('MONGO_HOST')) ? getenv('MONGO_HOST') : 'localhost', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplify it with ?: 'localhost'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and also remove brackets around getenv('MONGO_HOST')
.gitignore
Outdated
@@ -4,3 +4,4 @@ test/data/ | |||
test/assets/module/*/config/module.config.php | |||
clover.xml | |||
coveralls-upload.json | |||
docker/data/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any usage of this folder, can we remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was a remnant; removed
Dockerfile
Outdated
openssl-dev | ||
|
||
RUN echo "memory_limit=2G" >> /usr/local/etc/php/php.ini | ||
RUN if [ ${PHP_VERSION:0:3} == "5.6" ] ; then pecl install mongo && echo "extension=mongo.so" >> /usr/local/etc/php/php.ini ; else pecl install mongodb && docker-php-ext-enable mongodb ; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be better to make it explicit with another build argument? What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we use TRAVIS_PHP_VERSION a build argument is not the correct solution here. Comparing the substr of the PHP_VERSION works nicely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point that @thomasvargiu is making is that we can provide this as a flag instead of a version number via a build argument in docker-compose.yml
(as he demonstrates in another comment). If the initial docker-compose (build|up --build)
operation includes appropriate ENV variables, these can be referenced via docker-compose.yml
build arguments and referenced in the Dockerfile
. That would arguably be better than parsing versions in the Dockerfile
, and make it more explicit the scenarios we are testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TomHAnderson In general looks good, just small issues, agree with @thomasvargiu comments.
Thanks for doing it. Great job!
test/config/ODM/local.php
Outdated
@@ -8,8 +8,8 @@ | |||
'doctrine' => [ | |||
'connection' => [ | |||
'odm_default' => [ | |||
'server' => 'localhost', | |||
'port' => '27017', | |||
'server' => (getenv('MONGO_HOST')) ? getenv('MONGO_HOST') : 'localhost', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and also remove brackets around getenv('MONGO_HOST')
Dockerfile
Outdated
@@ -0,0 +1,21 @@ | |||
ARG PHP_VERSION=7.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move it into .docker
directory and add this directory to .gitattributes
(also other files with docker configuration)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only files with Docker configuration are Dockerfile and docker-compose.yml. Adding these to .gitattributes is fine but creating a directory for the Dockerfile isn't necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we eventually add more assets, however, we'll want to create that directory. I'd rather create it now so that once that happens, existing contributors are not then confused about where the files moved.
DOCKER.md
Outdated
@@ -0,0 +1,33 @@ | |||
# Docker for Development |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we don't need separate file and we should have this as a section in CONTRIBUTING.md
only? @weierophinney what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree; add this to the existing CONTRIBUTING.md file.
@@ -85,6 +80,7 @@ install: | |||
script: | |||
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use docker here too. We need to install xdebug on the docker image and then we can run tests with coverage:
$ docker-compose run --rm php ./vendor/bin/phpunit --colors=always --coverage-clover clover.xml
or, for test only:
$ docker-compose run --rm php ./vendor/bin/phpunit --colors=always
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage is only tested on one matrix element. The output of running coverage on Docker would not be used. I don't think Docker coverage is necessary. Is there a place the output would be used I'm not seeing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TomHAnderson We need to find a way to load xdebug extension only for coverage test.
I think should be better to create a .docker
directory to put there docker files as @webimpress suggested.
Then we could:
- Write the entry point file and use
COPY
orADD
in theDockerfile
, without to write it "on the fly" building the image - Install xdebug extension, without enabling it
- Create sh commands and copy them in the Dockerfile image
Then we can use a test-with-coverage script that will enable xdebug first:
#!/bin/sh
docker-php-ext-enable xdebug \
&& ./vendor/bin/phpunit --colors=always --coverage-clover clover.xml
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the need for coverage inside Docker. What benefit do we get?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TomHAnderson My idea is that if we are implementing docker, we should use it for everything.
It's not just a coverage, but are tests too. Right now tests are executed 2 times. First in the travis-ci environment (that it's different from the container) with coverage, then from the container.
I think we should use every command from the container, even composer install
and php-coveralls
.
After all these changes, we don't need to do anything on travis-ci environment, and then we can use a simple image on travis.
It's just my opinion and a suggestion :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that, thanks.
In this same thread @Ocramius suggests doing inside (Docker) and out (Travis) testing: #308 (comment)
@webimpress I need sign-off from you too before I'm going to go with a Docker-only approach to unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get the reasoning from @Ocramius , and generally agree. The idea should be to run the tests via docker always, for every environment, and not using the travis-ci environment; the rationale is to ensure that the CI environment mimics the environment maintainers use.
That said: only do it if it can be feasibly setup. If this is going to take you days to accomplish, then I'm not 100% convinced it's worth it; in that case, the docker setup is simply so contributors do not need to have the required services (mongo, RDBMS systems, etc) running on their own machine, nor need to configure a phpunit.xml
with the specifics of their own services.
If it is possible to do easily, let's do it. Use build arguments to do things like enable xdebug and indicate test coverage should be run.
.travis.yml
Outdated
@@ -85,6 +80,7 @@ install: | |||
script: | |||
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi | |||
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi | |||
- docker-compose run --rm php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is duplicated, it's the 2nd time tests are executed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, we want to run tests in Travis and run them again in Docker.
I fixed xdebug. You didn't read slide 11: https://docs.google.com/presentation/d/1KhcfyU4nKVUoaTczCuMPNVymw3GaTWrtfUTwB-TzJrs/edit#slide=id.g378fb9fb7b_0_99 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TomHAnderson Some notes to improve a bit documentation and it looks GREAT to me 😃
.travis.yml
Outdated
- stty cols 120 && composer show | ||
|
||
script: | ||
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi | ||
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi | ||
|
||
after_script: | ||
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry php vendor/bin/php-coveralls -v ; fi | ||
|
||
notifications: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why it is removed, we need it back.
CONTRIBUTING.md
Outdated
Next, from the root directory of this project, run | ||
|
||
``` | ||
docker-compose build --build-arg PHP_VERSION=7.2 --build-arg XDEBUG=0 --no-cache php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can simplify it here:
$ docker-compose build
because as said above PHP_VERSION=7.2 and XDEBUG=0 are default values. Then we should say if you want customize your container with different php version or enabled xdebug run:
$ docker-compose build --build-arg PHP_VERSION=7.1 --build-arg XDEBUG=1
(not sure also if we need --no-cache
param - I need to check it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like --no-cache in .travis.yml. I had instances using cached build 'parts' with php 5.6 used for all builds while testing. Could have been anything but I think Docker doesn't consider build parameters when cache is enabled.
CONTRIBUTING.md
Outdated
To connect to the php container for development run | ||
|
||
``` | ||
docker-compose run php bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need here also --rm
param.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Developing locally it's not necessary to remove the container each time. But putting it in the docs is fine by me.
docker-compose run php bash | ||
``` | ||
|
||
### RUNNING UNIT TESTS IN THE CONTAINER | ||
|
||
First, use [Composer](https://getcomposer.org) to install all dependencies: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need that anymore as it is installed on docker. Just we need to note that following commands have to be run in docker container (so after connection as described in previous section).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it isn't installed in docker. Travis runs composer. A fresh copy of the module and running Docker will not run composer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is installed in our docker container:
https://github.com/zfcampus/zf-apigility-doctrine/pull/308/files#diff-ed3ef792c56bca0b45e534f8b1444c01R15 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah, sorry, of course, composer is installed but dependencies are not :) I red this paragraph wrong.
CONTRIBUTING.md
Outdated
You may run the unit tests through the container without running bash via | ||
|
||
``` | ||
docker-composer run --rm php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the command form Dockerfile
so it is no longer working. In previous section we already have how to run tests. We can note that is it possible also tu run tests or just command using:
$ docker-compose run --rm php composer test
docker-compose.yml
Outdated
php: | ||
build: | ||
context: . | ||
dockerfile: docker/Dockerfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should have .docker
directory instead. I've seen it somewhere and I think it's better convention.
In other repos we usually uses .ci
dir for travis config.
docker/Dockerfile
Outdated
ARG PHP_VERSION=7.2 | ||
FROM php:${PHP_VERSION}-alpine | ||
|
||
ARG XDEBUG=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to note: this is really important !! MUST BE HERE, cannot be above FROM
:) Thanks @TomHAnderson !!
docker/Dockerfile
Outdated
|
||
RUN echo -e 'memory_limit=2G' > /usr/local/etc/php/conf.d/memory.ini | ||
RUN set -o pipefail && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | ||
RUN if [ ${PHP_VERSION:0:3} == "5.6" ] ; then \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying it before, and I think we can just have here $PHP_VERSION == "5.6"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No-can-do. Removing the substr and brackets breaks the build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docker installs v 5.6.16 or something so it's not about the parameter Docker accepts, it's about the value Travis supplies.
docker/Dockerfile
Outdated
else \ | ||
pecl install mongodb && docker-php-ext-enable mongodb ; \ | ||
fi | ||
RUN if [ ${XDEBUG} == "1" ] ; then pecl install xdebug && docker-php-ext-enable xdebug ; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here probably we don't need {}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, but I'm keeping them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ${VAR} converts --build-arg XDEBUG=1
or --build-arg XDEBUG="1"
.gitattributes
Outdated
@@ -5,3 +5,5 @@ | |||
.travis.yml export-ignore | |||
phpcs.xml export-ignore | |||
phpunit.xml.dist export-ignore | |||
docker-compose.yml export-ignore | |||
Dockerfile export-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed it before: we need to have here the whole /.docker/
directory, not just the Dockerfile
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done following test example in same file
Nice work @TomHAnderson! Other proposals: Ignore the
|
Not sure about it. If you want to test with different PHP version you can do:
and then:
(or maybe it is even possible to do in one line?) But in general I can see your point, we just need to think what will be the most convenient for contributors.
Yes! This is a very good idea. The script will be clearer. |
Agree with @thomasvargiu that we should include as a dist allowing devs to have their own docker-compose.yml |
I've used docker-compose.yml.dist now because @Ocramius thought (at one point) it was good to have my own composer environment to work on a repo and I agree. Using a .dist allows for custom environments. Now that entrypoint.sh is a script I've added a touch of ascii art to the shell when you login to the php container. I feel strongly this should stay as-is. This PR is now at RC |
@TomHAnderson @thomasvargiu I was looking again on docker-compose.yml.dist file solution. I have found this in the docker documentation: https://docs.docker.com/compose/extends/ |
I like the docker supported method for this over the .dist approach. |
.gitignore
Outdated
@@ -4,3 +4,4 @@ test/data/ | |||
test/assets/module/*/config/module.config.php | |||
clover.xml | |||
coveralls-upload.json | |||
docker-compose.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't ignore that file, but docker-compose.override.yml
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed this around to override.
@@ -70,7 +70,12 @@ | |||
"ZFTest\\Apigility\\Doctrine\\": "test/src/" | |||
} | |||
}, | |||
"bin": [ | |||
"./scripts/mongodb-shim" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about it, and I think we shouldn't have it here. Maybe it should be a part of https://github.com/doctrine/mongodb because of it we need to install that extra dependency on PHP 7+.
What I will do here... As we still support PHP 5.6 I would change default version in docker container to PHP 5.6 so then we don't need to install anything extra, and then describe in the docs (any maybe show message on container building) that for PHP 7+ we need install extra dependency. What do you think, @TomHAnderson ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I think your proposed solution is workable.
- Using the least common denominator of PHP 5.6 is like I don’t try to predict the future. I try to prevent it. I could very well be overly pessimistic here. I liked the pro-active approach better. What about not installing the script in composer / 'everyone gets a copy' and instead installing in a bin/ directory local to the project so it is only ran from composer events? But, I have to plead ignorance, would the event be fired when the repository is included in another project too? If so I fall back to 1.
This repository has been closed and moved to laminas-api-tools/api-tools-doctrine; a new issue has been opened at laminas-api-tools/api-tools-doctrine#3. |
This repository has been moved to laminas-api-tools/api-tools-doctrine. If you feel that this patch is still relevant, please re-open against that repository, and reference this issue. To re-open, we suggest the following workflow:
|
New Doctrine modules are coming down the pipe. To avoid trying to manipulate my bare metal I wrote this Docker container set for use in development and testing.
This isn't normal for Zend packages so please let me know your thoughts on including Docker container with complex repositories and let's get this merged and ready for the upcoming Doctrine changes.