Skip to content

Latest commit

 

History

History
68 lines (55 loc) · 2.32 KB

overrides.md

File metadata and controls

68 lines (55 loc) · 2.32 KB

Overriding default configuration

The workspace.yml file provides a means of defining new configuration as well as overriding the defaults that the harness provides.
More information can be found on the attribute type in the Workspace documentation here

Set an attribute value

Take a moment to see the attributes that are defined in the Drupal 8 harness.yml. These are built on the defaults from common.yml in the base harness.
These can all be customised in workspace.yml using attribute().

Here are some examples:

  • Change the database name:
    attribute('database.name'): 'mysite'
  • Use a different PHP version:
    attribute('php.version'): '7.2'
  • You can use existing attributes to define others using expressions:
    # Set the local URL to mysite.my127.site
    attribute('hostname'): = 'mysite.' ~ @('domain')

Merge not override

Strictly speaking you are not actually overriding attributes but rather merging with the defaults.

Take for example the services enabled in the Drupal 8 harness.yml:

  services:
    - chrome
    - mysql
    - redis

If you wanted to enable only the mysql service you may think of adding the following to workspace.yml:

attribute('services'):
  - mysql

However, this would ultimately end up as:

  services:
    - mysql
    - mysql
    - redis

Instead, you will need to set the lines that you wish to remove to NULL, using ~:

attribute('services'):
  - ~
  - mysql
  - ~

Steps[]

In harness.yml there are a number of steps defined, such as; backend.build.steps, backend.install.steps and backend.migrate.steps.
You can find even more in common.yml, e.g. frontend.build.steps.

When you see steps, there will more than likely be a task that defines how and when these steps are executed.

To understand more, take a look at the tasks in the console docker image here