Skip to main content
Version: 5.x

Config Expressions

Config expressions are a powerful feature to load the devspace.yaml in a more dynamic way. A config expression works by specifying $( my bash expression ) instead of a field and the stdout of the bash expression is taken as value for the option or complete section. Config expressions are evaluated after variables and profiles are applied to the config and can change parts of the config.

Load a deployment specification from file:

deployments:
- $(cat deployment.yaml)
info

Expressions are run in a golang shell that is syntax compatible to a regular POSIX shell and works on all operating systems. Check the github repository for a complete list of available commands

info

Variables are resolved before and after applying expressions, which means that you can load a section from file within an expression that contains a variable which will still be resolved afterwards.

Unsupported Config Expressions

Expressions are not supported in these configuration properties:

  • vars
  • profiles[*].name
  • profiles[*].parent
  • profiles[*].parents
  • profiles[*].activations
  • profiles[*].patches[*].op
  • profiles[*].patches[*].path

Testing Config Expressions

The command devspace print can be used to test your config expressions and shows the config after all profiles, variables and expressions were applied.