Skip to content

Universal config composition #175

Closed
Closed
@shiftedreality

Description

@shiftedreality

Since the introduction of .magento.docker.yaml file, there were added multiple sources to handle different approaches.

Universal file introduction: #160

Sources overview

The Source is a PHP entity responsible for reading the configuration from different file sources.

Composition

All the sources are being composed according to the preferred hierarchy.

build:compose command

This command is backward-compatible with Cloud Docker 1.0, this means that all CLI options and Magento Cloud Docker configurations are preserved. On top of it, we added support of .magento.docker.yaml file.

The composition hierarchy is next (left to right priority):

BaseSource -> CloudBaseSource -> CloudSource -> ConfigSource -> CliSource

        $config = $this->configFactory->create([
            $this->sourceFactory->create(Source\BaseSource::class),
            $this->sourceFactory->create(Source\CloudBaseSource::class),
            $this->sourceFactory->create(Source\CloudSource::class),
            $this->sourceFactory->create(Source\ConfigSource::class),
            new Source\CliSource($input)
        ]);

This means next:

  • CliSource has higher priority, so it's possible to change any configuration via CLI
  • ConfigSource has a higher priority than CloudSource. This means that Developers who want to apply custom local changes on top of .magento.app.yaml and .magento/services.yaml have such a possibility.

build:custom:compose future command

This command can be added in the future to specify what source you want to use. This may be useful for CI/CD infrastructure where you want to have full control over the Deployment environment specification.

This command will work using 1 Source - JsonSource which converts input string to universal representation.

Possible arguments:

  • config - A JSON string to represent the full configuration list.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions