From 8e16e49c6419ce02e667f73efadd5ab56a5e0d41 Mon Sep 17 00:00:00 2001 From: Andreas de Pretis Date: Tue, 17 Oct 2017 11:07:35 +0200 Subject: [PATCH 1/2] Add make target 'console' - passing Symfony console args through CMD --- Makefile | 10 +++++++++- README.md | 5 +---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 72fa843..0309cf5 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,16 @@ up:: ##@Sylius Start the Sylius stack for development (using docker-compose) --build .PHONY: shell -shell:: ##@Sylius Bring up a shell +shell:: ##@Development Bring up a shell docker exec \ -ti \ syliusdocker_sylius_1 \ bash + +.PHONY: console +console:: ##@Development Call Symfony "console" with "console []" + docker exec \ + -ti \ + -u www-data \ + syliusdocker_sylius_1 \ + sylius/bin/console $(CMD) diff --git a/README.md b/README.md index d940658..4ea5243 100644 --- a/README.md +++ b/README.md @@ -18,10 +18,7 @@ You can control, customize and extend the behaviour of this environment with ``m git clone https://github.com/sylius/docker sylius-docker make help make up -make shell - -root@aa67dd3b767c:/var/www# cd sylius/ -root@aa67dd3b767c:/var/www/sylius# bin/console sylius:install +make console CMD=sylius:install ``` ### Accessing services and ports From 9bf5acfe3cf3700b89adc638b1604b6dbb08835d Mon Sep 17 00:00:00 2001 From: Andreas de Pretis Date: Tue, 17 Oct 2017 11:26:35 +0200 Subject: [PATCH 2/2] Update documentation with examples for make console --- README.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4ea5243..631920e 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ The development environment consists of 3 containers, running You can control, customize and extend the behaviour of this environment with ``make`` - see ``make help`` for details. It is built around the principles and ideas of the [Docker Make Stub](https://github.com/25th-floor/docker-make-stub). -## Development +# Development -### Quickstart +## Quickstart ``` git clone https://github.com/sylius/docker sylius-docker @@ -21,7 +21,7 @@ make up make console CMD=sylius:install ``` -### Accessing services and ports +## Accessing services and ports | Service | Port | Internal DNS | Exported | |----------------|-------|--------------|----------| @@ -30,7 +30,7 @@ make console CMD=sylius:install | MailHog (SMTP) | 1025 | mailhog | No | | MailHog (HTTP) | 8025 | mailhog | Yes | -### Customizing docker-compose.yml +## Customizing docker-compose.yml You can create a ``docker-compose.local.yml`` to further extend the docker-compose configuration by overloading the existing YAML configuration. If this file exists ``make up`` will recognize and add it as ``-f docker-compose.local.yml`` when executing docker-compose. @@ -49,7 +49,19 @@ Please note array elements (ports, environments, volumes, ...) will get **merged To change the e.g. exposed ports for your local environment you have to edit ``docker-compose.yml`` for now. -## Support for you Deployment Pipeline +## Running Symfony Console + +You can always execute Symfony Console either by getting an interactive shell in the application container using ``make shell``. For some a more convenient way might be using ``make console`` which is a wrapper for that. + +When using the wrapper target you can pass arguments to ``console`` by using the ``CMD`` variable: + +```bash +make console CMD=sylius:install +make console CMD="sylius:user:promote awesome@sylius.org" +make console CMD="sylius:theme:assets:install web --symlink --relative" +``` + +# Support for you Deployment Pipeline TODO