Pipeline Configuration file
ReadyMage supports user defined configuration file that can inject various actions into different points of build/deploy pipeline or customize existing pipeline logic.
Used terms
Vanilla Magento theme - a theme which uses Magento built in mechanisms of theme server-side compilation. For example Magento/Luma
.
How to use
Add the readymage.yaml
file to Magento 2 root folder. It's the folder which contains base Magento 2composer.*
files.
Examples
Schema
By default, ReadyMage will attempt to validate configuration file before running its directives. If its invalid, the build will automatically fail with a relevant error about which parts of the schema are invalid or failed to be ran.
schema_version
schema_version
Required. Specifies which schema version is used in the configuration file. Allowed values: 1.0.0
environments
environments
Optional. Array of environment specific configurations
If there are no themes specified for the environment, all available Magento themes will be built for all areas, with the default language of en_US
or, if specified, languages defined in config.php
name
Required. Environment full name.
build
Optional. Nested dictionary containing build specific configurations.
themes
Optional. Dictionary of environment themes. Themes directive allows to specify which of themes should be built. This includes theme compilation and locale specific static file generation.
{theme}
Theme ID
<Vendor>/<theme>
as defined in registration.php. Useall
to generate static files for all Magento themes.area
Optional. Allowed values:
all
,frontend
,adminhtml
. If not defined, will fallback toall
languages
Optional. Allowed values: array of strings. If not defined, will fallback to locales specified in
config.php
or if none found - toen_US
playbook
Optional. Specifies which of the playbooks should be called during theme compilation. Ignored if theme ID is set to
all
directory
Required if playbook field is set. Specifies in which directory the theme is located at. Ignored if theme ID is set to
all
hooks
Optional. Hooks are way to inject custom logic around automated actions (e.g. build). For example if you need to swapconfig.php
file for specific environment before the build. Allowed values:pre_build
,post_build.
To customize theme compilation and static content file generation logic, use playbook and theme directives instead of using the hooks.pre_build
post_build
deploy
Optional. Nested dictionary containing deploy specific configurations.hooks
Optional. Hooks in this context offer a way to execute the needed commands throughout the deployment.post_deploy
This hook runs after the deployment has completed successfully. Available commands arephp
andcurl
only.
playbooks
playbooks
Optional. Dictionary of playbooks.
A playbook is set of actions that are called on the theme build/compilation step. It’s invoked during the build pipeline before automated setup:static-content:deploy
. To customize static-content deployment, use themes directive.
Playbooks can only contain actions. All the actions defined inside a playbook will be executed in sequentially manner.
Out of the box ReadyMage provides several playbooks, alongside with the possibility of defining fully custom playbooks.
scandipwa
, scandipwa_npm
scandipwa
, scandipwa_npm
Curated, builtin playbook which is actively maintained and test against 3.x and higher ScandiPWA themes. The approximation of the curated playbook can be expressed using following actions:
scandipwa_yarn
scandipwa_yarn
Curated, builtin playbook which is actively maintained and test against 3.x and higher ScandiPWA themes. The approximation of the curated playbook can be expressed using following actions:
Custom
To create custom theme build/compilation logic which falls outside the curated playbooks, simply create a custom playbook where all of the necessary build actions can be defined. This can be accomplished by defining a set of actions grouped inside the playbook that will be responsible for theme compilation. The resulting playbook will be available on any environments themes playbook field.
To build vanilla Magento themes, there is no need to specify playbook.
actions
actions
Actions are generic, cherry-picked commands that are executed in pre-defined places inside the deployment pipeline. Actions can only be used inside playbooks or hooks.
copy
{source}: {destination}
move
{source}: {destination}
symlink
Creates symbolic link at the path pointing to the target. The path is relative to the Magento installation directory. The target is relative to the Magento installation directory, unless prefiexed with
persistent:
Will overwrite the file/directory if it exists at path.{path}: {target}
persistent:
prefix in target to set a symlink persistent and shared directory.
composer
Runs custom composer v1 or v2 commands. Use only if you have additional non-magento composer installations inside the project that have to be initialized after the main build.
command
- Required.version
- Required. Allowed values:1
,2
directory
- Optional. If not defined, will fallback to theme directory.
Composer state should be always managed by composer.json
and composer.lock
files instead of configuration file actions!
curl
(available on post_deploy hooks only)
curl
(available on post_deploy hooks only) command
- Required.directory
- Required. Must specify an absolute path to the/mnt/
directory.filename
- Required. Must specify the name of the downloaded file.
Schema migrations
Last updated