Conditionally setting values in the config file

Conditionally Set Values

When using parameters and pipeline values in your config.yml file, it is possible to conditionally set a value. 

To check if a value is true or a non-empty string:

<<#parameters.parametername>> <</parameters.parametername>>

To check if a value is false or an empty string:
<<^parameters.parametername>> <</parameters.parametername>>

For example, you can conditionally insert a value into your config.yml file based on whether pipeline.git.tag contains a value.

<<#pipeline.git.tag>>Sometext<</pipeline.git.tag>>

In the above example, the line <<#pipeline.git.tag>>Sometext<</pipeline.git.tag>> would be replaced with Sometext if pipeline.git.tag contained a value.

Was this article helpful?
8 out of 14 found this helpful

Comments

0 comments

Article is closed for comments.