Overriding Setup Defaults

The values prompted for when you add a new configuration, and the default values offered by setup are all defined in the setup/defaults folder. This folder contains a set of default configuration files (cook-config.yaml, fridge-config.yaml, cleaver-config.yaml, docker-compose.yml and waiter-config.yaml) plus a blueprint.yaml file that defines:

  • The values setup add is to prompt for

  • The prompt texts to display

  • Defaults for the prompted values

When you create a CUE Front configuration using the setup add myconfig command, the setup utility:

  1. Displays the sequence of prompts defined in CUE Front's setup/defaults/blueprint.yaml file.

  2. Creates a cue-front/myconfig folder and saves your responses in cue-front/myconfig/blueprint.yaml.

  3. Merges the values in cue-front/myconfig/blueprint.yaml with the default configuration files in the cue-front/setup/defaults folder

  4. Saves the merged configuration files in the cue-front/myconfig/ folder together with blueprint.yaml.

If you wanted to change the setup defaults, you could do so by modifying these files. You could, for example, change the default value for one of the setup prompts by editing setup/defaults/blueprint.yaml, or you could change the content of all the cook-config.yaml files generated by the setup tool by editing setup/defaults/cook-config.yaml. However, any changes you made in this way would be overwritten the next time CUE Front was upgraded.

The correct way to override the supplied defaults, therefore, is to create a copy of the cue-front/setup/defaults folder in your publication repo, and edit the copied files. When setup add is run, it will actually check your publication repo first, and if it finds any setup defaults, use those instead of the defaults supplied with CUE Front.

In detail, do as follows to create your own customized set of defaults:

  1. Copy the setup defaults folder from the CUE Front folder to your publication repo:

    mkdir publication-path/setup
    cp cue-front-path/setup/defaults/ publication-path/setup/
  2. Delete any copied files that you don't intend to modify, for example:

    cd publication-path/setup/defaults/
    rm cook-config.yaml fridge-config.yaml cleaver-config.yaml docker-compose.yml

    You should always delete docker-compose.yml from your publication setup/defaults folder. Currently, it is not possible to customize the default docker-compose.yml file.

  3. Edit the files to meet your needs.

When editing actual configuration files in your override folder (i.e, waiter-config.yaml in this case), simply make the changes you need. When editing blueprint.yaml, however, you should edit the entries you want to change and delete all the other entries. In this way, only the settings you are actually interested in will be overridden. If, for example, you want to change the default value of the Waiter's devmode property to false, then you can do so by creating a blueprint.yaml file that contains just the following lines:

waiter:
  devmode:
    advanced: true
    default: false

If you want to prevent setup from prompting for a value rather than just modify the default, you can do so by adding the following property:

    condition: "false"

to its definition. For example:

waiter:
  devmode:
    advanced: true
    default: false
    condition: "false"

Note that the condition property must be a string, "false", not a boolean value.

If you want to remove a property completely from the output blueprint.yaml file generated by setup add, then you can do so by setting the default value to nothing and adding condition: "false". The following, for example, completely removes the Waiter's publications-name property from the output blueprint.yaml file:

waiter:
  publications-name:
    message: "Publication-name"
    default: ""
    condition: "false"

For an example of why you might need to be able to do this, see Multi-publication Support.