From 1fe4fe3807bd2bec9ea7db7289a63f66a0310ba6 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Mon, 19 Nov 2018 13:31:09 +0100 Subject: [PATCH] OPENEUROPA-1322: Use the proper Docker way of overriding docker-composer.yml file. --- .github/pull_request_template.md | 22 +++++++ .gitignore | 2 +- README.md | 63 +++++++++++++++---- docker-compose.yml.dist => docker-compose.yml | 0 4 files changed, 75 insertions(+), 12 deletions(-) create mode 100644 .github/pull_request_template.md rename docker-compose.yml.dist => docker-compose.yml (100%) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..817b1862 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,22 @@ +## OPENEUROPA-[Insert ticket number here] + +### Description + +[Insert description here] + +### Change log + +- Added: +- Changed: +- Deprecated: +- Removed: +- Fixed: +- Security: + +### Commands + +```sh +[Insert commands here] + +``` + diff --git a/.gitignore b/.gitignore index f54adcea..54a51569 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,4 @@ behat.yml *.tar.gz /.idea/ runner.yml -docker-compose.yml +docker-compose.*.yml diff --git a/README.md b/README.md index c2520c8c..f7ee37b4 100644 --- a/README.md +++ b/README.md @@ -16,35 +16,67 @@ Quick references: Install it with [Composer](https://getcomposer.org): -``` -$ composer require openeuropa/task-runner +```bash +composer require openeuropa/task-runner ``` After installation run `./vendor/bin/run` for a list of available commands. ### Using Docker Compose -The setup procedure can be simplified by using Docker Compose. +Alternatively, you can build a development site using [Docker](https://www.docker.com/get-docker) and +[Docker Compose](https://docs.docker.com/compose/) with the provided configuration. + +Docker provides the necessary services and tools to get the tests running, regardless of your local host configuration. -Requirements: +#### Requirements: - [Docker](https://www.docker.com/get-docker) -- [Docker-compose](https://docs.docker.com/compose/) +- [Docker Compose](https://docs.docker.com/compose/) + +#### Configuration -Copy docker-compose.yml.dist into docker-compose.yml. +By default, Docker Compose reads two files, a `docker-compose.yml` and an optional `docker-compose.override.yml` file. +By convention, the `docker-compose.yml` contains your base configuration and it's provided by default. +The override file, as its name implies, can contain configuration overrides for existing services or entirely new +services. +If a service is defined in both files, Docker Compose merges the configurations. -You can make any alterations you need for your local Docker setup. However, the defaults should be enough to set the project up. +Find more information on Docker Compose extension mechanism on [the official Docker Compose documentation](https://docs.docker.com/compose/extends/). -Run: +#### Usage +To start, run: + +```bash +docker-compose up ``` -$ docker-compose up -d + +It's advised to not daemonize `docker-compose` so you can turn it off (`CTRL+C`) quickly when you're done working. +However, if you'd like to daemonize it, you have to add the flag `-d`: + +```bash +docker-compose up -d ``` Then: +```bash +docker-compose exec web composer install +``` + +#### Running the tests + +To run the grumphp checks: + +```bash +docker-compose exec web ./vendor/bin/grumphp run ``` -$ docker-compose exec web composer install + +To run the phpunit tests: + +```bash +docker-compose exec web ./vendor/bin/phpunit ``` ## Configuration @@ -167,7 +199,7 @@ After doing that remember to refresh your local autoloader by running `composer You can now access your new commands via the Task Runner main executable: -``` +```bash $ ./vendor/bin/run OpenEuropa Task Runner @@ -184,3 +216,12 @@ register them at startup. Even if not mandatory it is recommended for your command classes to extend `OpenEuropa\TaskRunner\Commands\AbstractCommands`. For more details on how to expose custom commands please refer to the main [Robo documentation](http://robo.li/getting-started). + +## Contributing + +Please read [the full documentation](https://github.com/openeuropa/openeuropa) for details on our code of conduct, and the process for submitting pull requests to us. + +## Versioning + +We use [SemVer](http://semver.org/) for versioning. For the available versions, see the [tags on this repository](https://github.com/openeuropa/task-runner/tags). + diff --git a/docker-compose.yml.dist b/docker-compose.yml similarity index 100% rename from docker-compose.yml.dist rename to docker-compose.yml