Fixed values, runtime inputs, and expressions
For most settings in Harness pipelines, you can use fixed values, runtime inputs, or expressions.
- Visual
- YAML
In the Pipeline Studio's Visual Editor, you can use the Value type selector to select Fixed Values, Runtime Input, or Expression.
The Expression option is especially useful, because it enables suggestions for built-in expressions as you type.
In free-text fields, such as Command, you can directly enter values using the appropriate syntax, such as <+input>
for runtime input, without changing the value type.
When writing pipelines in YAML, enter the value using the appropriate syntax. For example:
- For fixed values, enter the value directly.
- For runtime input, enter
<+input>
. - For expressions, enter the expression, such as
<+secrets.getValue("somesecret")>
.
When you type <+
, Harness provides suggestions for built-in expressions as you type.
Fixed values
Fixed Values are values that you define when you configure a setting. These values don't change at runtime.
Use fixed values for settings you don't need to change based on the build context, other steps, or runtime operations. For example, you can use fixed values in variables.
Runtime inputs
Runtime input provides a placeholder with the expectation that you'll define this value at runtime. For example, if you set the Kubernetes cluster Namespace setting to runtime input (<+input>
), you'll need to provide the Namespace value when you run the pipeline.
You can customize runtime inputs to have specific allowed values, default values, multi-selection, and more.
For more information, go to Use runtime input.
Expressions
Use expressions to reference Harness input, output, and execution variables. These variables represent settings and values that exist in the pipeline before and during execution. These can include environment variables, secrets, pipeline/stage/step identifiers, and more.
At pipeline runtime, Harness replaces the expression with the resolved value.
- Visual
- YAML
In the Pipeline Studio's Visual Editor, you can use the Value type selector to select Expression.
Harness provides suggestions for built-in expressions as you type. You can manually trigger the suggestions by placing your cursor after <+
and pressing ctrl + space
.
In free-text fields, such as Command, you can directly enter values using the appropriate syntax without changing the value type.
You can continue typing or select the expression from the list of suggestions.
When writing pipelines in YAML, enter the expression using the appropriate syntax.
When you type <+
, Harness provides suggestions for built-in expressions as you type. You can manually trigger the suggestions by placing your cursor after <+
and pressing ctrl + space
.
You can continue typing or select the expression from the list of suggestions.
For more information, go to: