diff --git a/src/cloud/project/magento-env-yaml.md b/src/cloud/project/magento-env-yaml.md index c32a901679a..776bc8687bb 100644 --- a/src/cloud/project/magento-env-yaml.md +++ b/src/cloud/project/magento-env-yaml.md @@ -67,3 +67,45 @@ When a failure occurs because of an unexpected value in the `.magento.env.yaml` ``` Make any corrections, commit, and push the changes. If you do not receive an error message, then the changes to your configuration file pass the validation. + +## Create configuration file from CLI + +You can use the following `ece-tools` CLI commands to generate a `.magento.env.yaml` configuration file for a Cloud environment. + +```bash +php ./vendor/bin/ece-tools cloud:config:create # Creates a new configuration file +php ./vendor/bin/ece-tools cloud:config:update # Updates values in the configuration file +``` + +Both commands require a single argument, a JSON-formatted array that specifies a value for at least one build, deploy, or post-deploy variable. For example, the following command sets values for the `SCD_THREADS` and `CLEAN_STATIC_FILES` variables. + +```bash +php vendor/bin/ece-tools cloud:config:create '{"stage":{"build":{"SCD_THREADS":5}, "deploy":{"CLEAN_STATIC_FILES":false}}}' +``` + +This command creates a new .magento.env.yaml file with the following settings: + +```yaml +stage: + build: + SCD_THREADS: 5 + deploy: + CLEAN_STATIC_FILES: false +``` + +You can use the cloud:config:update command to update the new file. For example, the following command changes the `SCD_THREADS` value and adds the `SCD_COMPRESSION_TIMEOUT` configuration: + +```bash +php vendor/bin/ece-tools cloud:config:update '{"stage":{"build":{"SCD_THREADS":3, "SCD_COMPRESSION_TIMEOUT":1000}}}' +``` + +The updated file contains the following configuration: + +```yaml +stage: + build: + SCD_THREADS: 3 + SCD_COMPRESSION_TIMEOUT: 1000 + deploy: + CLEAN_STATIC_FILES: false +``` diff --git a/src/cloud/reference/ece-tools-reference.md b/src/cloud/reference/ece-tools-reference.md index 354e676f585..22fc144fd0b 100644 --- a/src/cloud/reference/ece-tools-reference.md +++ b/src/cloud/reference/ece-tools-reference.md @@ -19,39 +19,45 @@ php ./vendor/bin/ece-tools list ```terminal Available commands: - build Builds application - db-dump Creates backup of database - deploy Deploys application - help Displays help for a command - list Lists commands - patch Applies custom patches + build Builds application. + db-dump Creates database backups. + deploy Deploys application. + help Displays help for a command. + list Lists commands. + patch Applies custom patches. post-deploy Performs after deploy operations. - run Execute scenario(s) + run Execute scenario(s). backup - backup:list Shows the list of backup files + backup:list Shows the list of backup files. backup:restore Restore important configuration files. Run backup:list to show the list of backup files - build - build:generate Generates all necessary files for build stage - build:transfer Transfer generated files into init directory + build. + build:generate Generates all necessary files for build stage. + build:transfer Transfers generated files into init directory. + cloud + cloud:config:create Creates a `.magento.env.yaml` file with the specified build, deploy, and post-deploy variable configuration. Overwrites any existing `.magento,.env.yaml` file. + cloud:config:update Updates the existing `.magento.env.yaml` file with the specified configuration. Creates `.magento.env.yaml` file if it does not exist. config config:dump [dump] Dump configuration for static content deployment. cron - cron:disable Disable all Magento cron processes and kills currently running - cron:enable Enable Magento cron processes - cron:kill Kill all Magento cron processes + cron:disable Disable all Magento cron processes and kills currently running. + cron:enable Enable Magento cron processes. + cron:kill Kill all Magento cron processes. cron:unlock Unlock cron jobs that stuck in "running" state. dev dev:git:update-composer Updates composer for deployment from git. env - env:config:show Display encoded cloud configuration environment variables + env:config:show Display encoded cloud configuration environment variables. + error + error:show Display info about error by error id or info about all errors from the last deployment. module - module:refresh Refresh config to enable newly added modules + module:refresh Refresh config to enable newly added modules. wizard - wizard:ideal-state Verifies ideal state of configuration - wizard:master-slave Verifies master-slave configuration - wizard:scd-on-build Verifies SCD on build configuration - wizard:scd-on-demand Verifies SCD on demand configuration - wizard:scd-on-deploy Verifies SCD on deploy configuration + wizard:ideal-state Verifies ideal state of configuration. + wizard:master-slave Verifies master-slave configuration. + wizard:scd-on-build Verifies SCD on build configuration. + wizard:scd-on-demand Verifies SCD on demand configuration. + wizard:scd-on-deploy Verifies SCD on deploy configuration. + wizard:split-db-state Verifies ability to split DB and whether DB was already split or not. ``` {:.no-copy}