Configuration¶
Mach Composer allows for several different configurations that together definehow components will be applied.
deployment
¶
Thedeployment
sections define how the component will actually be deployed.This configuration can be set at the global level, the site level or thecomponent level, depending on your needs. In this case, component configurationwill be checked first, then site and finally the global level.
...global:# Global deployment type set to sitedeployment:type:sitesites:-identifier:my-site# No site deployment type set, so inherited from globalcomponents:-name:my-component# deployment type set to site-component, so component will be deployed# independentlydeployment:type:site-component-name:my-other-component# No component deployment type set, so inherited from sitecomponents:-name:my-component-name:my-other-component...
Set deployment type at the global level
It is recommended to set the deployment type tosite-component
at the globallevel when starting a new project. This will ensure that all components aredeployed in the same way, and no later migration is needed. The current defaultofsite
is only for backwards compatibility.
dependes_on
¶
Although in most cases Mach Composer will be able to determine the correctdependency order based on the component configuration, in some cases it isnecessary to explicitly define the dependencies between components. This can bedone using thedepends_on
configuration.
Note that setting this configuration will override the automatic dependency resolution completely.
This means that if you set this configuration, you will need to make sure thatthe dependencies are correct. If you are unsure, it is recommended to use theautomatic dependency resolution.
sites:-identifier:my-sitecomponents:-name:my-component-name:my-other-componentdepends_on:# This tells Mach Composer that my-other-component depends on my-component explicitly-my-component
The--workers
parameter¶
Finally, the--workers
parameter allows you to set the number of workers thatwill process updates concurrently. This can be useful if you have a large numberof independent components that need to be updated, and you want to speed up theprocess further
Note that this parameter is structurally limited by the automated batchprocessing of changes done by Mach Composer.Seeapplying changes for more information on how batchesare determined.
By default, a single worker is used
API Rate Limits
Take care with setting this parameter too high, as it can cause API rate limits issues with the underlying SAAS vendors.
mach-composerapply-fmy-site.yaml--workers10