Skip to content

Commit bb7c668

Browse files
committed
Deployment Process / ece-tools build:generate
1 parent f734c4b commit bb7c668

File tree

1 file changed

+70
-4
lines changed

1 file changed

+70
-4
lines changed

5. Deployment Process.md

+70-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ Build and deploy full steps:
3232
#php ./vendor/bin/ece-tools build
3333
```
3434
- result of the build phase is a read-only file system referred to as a slug
35-
- TODO: ./vendor/bin/ece-tools build:generate / build:transfer
3635
3. Prepare the slug
3736
- create an archive and put the slug in permanent storage
3837
- slug includes all files and folders excluding the mounts configured in `magento.app.yaml`
@@ -59,7 +58,6 @@ Build and deploy full steps:
5958
php ./vendor/bin/ece-tools deploy
6059
```
6160
- deploy script uses the values defined by configuration files in the `.magento` directory, then the script deletes the directory and its contents
62-
- TODO: php ./vendor/bin/ece-tools deploy
6361
6. Post-deployment: configure routing
6462
- creates backup (BAK) files for the app/etc/env.php and the app/etc/config.php configuration files
6563
- execute commands after deploying your application and after the container begins accepting connections
@@ -69,12 +67,80 @@ Build and deploy full steps:
6967
post_deploy: |
7068
php ./vendor/bin/ece-tools post-deploy
7169
```
72-
- TODO: php ./vendor/bin/ece-tools post-deploy
7370

7471
###### What role every process/phase plays and how to impact every process
75-
7672
###### How Magento Cloud deploys Magento. What every script does on every deployment phase
7773

74+
Ece-tools [\Magento\MagentoCloud\App\Container](https://github.com/magento/ece-tools/blob/develop/src/App/Container.php#L50) initialize [\Illuminate\Container\Container](https://laravel.com/api/5.5/Illuminate/Container/Container.html) and configure all commands processes.
75+
76+
**Build**
77+
78+
- `php ./vendor/bin/ece-tools build:generate`
79+
80+
- [Process\Build\PreBuild](https://github.com/magento/ece-tools/tree/develop/src/Process/Build/PreBuild.php)
81+
- check VERBOSE_COMMANDS in `.magento.env.yaml`
82+
- check and clean `generated/code` folder
83+
- check and clean `generated/metadata` folder
84+
- delete flag `.static_content_deploy` file
85+
- [Process\ValidateConfiguration](https://github.com/magento/ece-tools/tree/develop/src/Process/ValidateConfiguration.php)
86+
```php
87+
$this->container->make(\Magento\MagentoCloud\Process\ValidateConfiguration::class, [
88+
'validators' => [
89+
ValidatorInterface::LEVEL_CRITICAL => [
90+
$this->container->make(ConfigValidator\Build\ComposerFile::class),
91+
$this->container->make(ConfigValidator\Build\StageConfig::class),
92+
$this->container->make(ConfigValidator\Build\BuildOptionsIni::class),
93+
],
94+
ValidatorInterface::LEVEL_WARNING => [
95+
$this->container->make(ConfigValidator\Build\ConfigFileExists::class),
96+
$this->container->make(ConfigValidator\Build\DeprecatedBuildOptionsIni::class),
97+
$this->container->make(ConfigValidator\Build\StageConfigDeprecatedVariables::class),
98+
$this->container->make(ConfigValidator\Build\ModulesExists::class),
99+
$this->container->make(ConfigValidator\Build\AppropriateVersion::class),
100+
$this->container->make(ConfigValidator\Build\ScdOptionsIgnorance::class),
101+
$this->container->make(ConfigValidator\IdealState::class),
102+
],
103+
],
104+
]),
105+
```
106+
see [Config/Validator/Build](https://github.com/magento/ece-tools/tree/develop/src/Config/Validator/Build) folder
107+
- [Process\Build\RefreshModules](https://github.com/magento/ece-tools/tree/develop/src/Process/Build/RefreshModules.php)
108+
- see [\Config\Module::refresh](https://github.com/magento/ece-tools/tree/develop/src/Config/Module.php)
109+
- enable all modules `php ./bin/magento module:enable --all --ansi --no-interaction` if `modules` not found in the `app/etc/config.php`
110+
- [Process\Build\ApplyPatches](https://github.com/magento/ece-tools/tree/develop/src/Process/Build/ApplyPatches.php)
111+
- applying patches (`Patch\Manager::applyAll`)
112+
- copyStaticFile: copy `pub/static.php` => `pub/front-static.php`
113+
- applyComposerPatches: from [patches.json](https://github.com/magento/ece-tools/blob/develop/patches.json) file
114+
- applyHotFixes: `git apply` patches from `m2-hotfixes/*.patch`
115+
- [Process\Build\MarshallFiles](https://github.com/magento/ece-tools/tree/develop/src/Process/Build/MarshallFiles.php)
116+
- delete `var/cache/` directory
117+
- copying di.xml files for Magento version < 2.2
118+
- [Process\Build\CopySampleData](https://github.com/magento/ece-tools/tree/develop/src/Process/Build/CopySampleData.php)
119+
- copy (if exists) `vendor/magento/sample-data-media` => `/pub/media`
120+
- [Process\Build\CompileDi](https://github.com/magento/ece-tools/tree/develop/src/Process/Build/CompileDi.php)
121+
- execute `php ./bin/magento setup:di:compile {$verbosityLevel} --ansi --no-interaction`
122+
- [Process\Build\ComposerDumpAutoload](https://github.com/magento/ece-tools/tree/develop/src/Process/Build/ComposerDumpAutoload.php)
123+
- execute `composer dump-autoload -o --ansi --no-interaction`
124+
- [Process\Build\DeployStaticContent](https://github.com/magento/ece-tools/tree/develop/src/Process/Build/DeployStaticContent.php)
125+
- delete `scd_in_build` flag
126+
- validate [Config\Validator\GlobalStage\ScdOnBuild::validate](https://github.com/magento/ece-tools/blob/develop/src/Config/Validator/GlobalStage/ScdOnBuild.php#L72)
127+
- check SCD_ON_DEMAND
128+
- check SKIP_SCD
129+
- validate [Config\Validator\Build\ConfigFileStructure::validate](https://github.com/magento/ece-tools/blob/develop/src/Config/Validator/Build/ConfigFileStructure.php#L63)
130+
- in the `app/etc/config.php`
131+
- scopes/websites (count($websites) > 0)
132+
- scopes/stores (count($stores) > 0 )
133+
- if all checks valid execure [Process\Build\DeployStaticContent\Generate](https://github.com/magento/ece-tools/tree/develop/src/Process/Build/DeployStaticContent/Generate.php)
134+
- TODO:
135+
136+
- `php ./vendor/bin/ece-tools build:transfer`
137+
138+
**Deploy**
139+
- `php ./vendor/bin/ece-tools deploy`
140+
141+
**Post_deploy**
142+
- `php ./vendor/bin/ece-tools post-deploy`
143+
78144
###### How to extend these scripts and best practices for doing so
79145

80146
###### Describe the ways to retrieve logs for phases and its scripts

0 commit comments

Comments
 (0)