Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3a02634

Browse files
meker12oshmyheliuk
andauthoredSep 22, 2020
MCLOUD-6896: Add possibility to pass ECE-Tools environment variables … (#7909)
* MCLOUD-6896: Add possibility to pass ECE-Tools environment variables (#7907) * MCLOUD-6896: Add possibility to pass ECE-Tools environment variables * Apply suggestions from code review Co-authored-by: Margaret Eker <[email protected]> Co-authored-by: Oleksandr Shmyheliuk <[email protected]>
1 parent 3287002 commit 3a02634

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
 

‎src/cloud/docker/docker-config.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,33 @@ To skip the interactive mode, use the `-n, --no-interaction` option.
4646
{:.bs-callout-info}
4747
The mode option for the `ece-docker build:compose` command does not affect the Magento mode. It determines the {{site.data.var.ece}} file system installation and read-only or read-write behavior.
4848

49+
## Set the environment variables
50+
51+
You can launch a Cloud Docker environment with predefined environment variables by adding the `--env-vars` option to the `ece-docker build:compose` command.
52+
53+
For example, the following command sets values for the `LOCK_PROVIDER` and `CRON_CONSUMERS_RUNNER` environment variables.
54+
55+
```bash
56+
bin/ece-docker build:compose --env-vars="{\"MAGENTO_CLOUD_VARIABLES\":{\"LOCK_PROVIDER\":\"db\",\"CRON_CONSUMERS_RUNNER\":{\"cron_run\":\"true\",\"max_messages\":5000,\"consumers\":[\"test\"]}}}"
57+
```
58+
59+
You must escape special characters when specifying the value for the `--env-vars` option. Use the following PHP script to generate the escaped value. Update the example with the values required for your Cloud Docker environment configuration.
60+
61+
```php
62+
<?php
63+
64+
echo addslashes(json_encode([
65+
'MAGENTO_CLOUD_VARIABLES' => [
66+
'LOCK_PROVIDER' => 'db',
67+
'CRON_CONSUMERS_RUNNER' => [
68+
'cron_run' => 'true',
69+
'max_messages' => 5000,
70+
'consumers' => ['test'],
71+
],
72+
]
73+
]));
74+
```
75+
4976
## Stop and start containers
5077

5178
You can stop containers and restore them afterwards using the following methods.

0 commit comments

Comments
 (0)
This repository has been archived.