Fixed Values, Runtime Inputs, and Expressions
Most settings in Harness Pipelines allow you to use Fixed Values, Runtime Inputs, and Expressions.
This topic describes each of these options.
In this topic:
Fixed Values are simply values that you enter manually when you configure a setting and do not change at runtime.
These are settings you don't need to change based on some other step or runtime operation.
For example, here'a a Timeout setting:
You can enter a value for this setting such as
10m 30s. That value is fixed and nothing that happens at runtime will change it.
When you use Runtime Inputs, you are setting placeholders for values that will be provided when you start a Pipeline execution.
You can template (or templatize) your Pipeline using Runtime Inputs, enabling users to select different values for each execution. For example, you can turn the Infrastructure Definition settings into Runtime Inputs and have users provide Dev, QA, and Prod values with each execution.
Furthermore, you can create Input Sets for the Runtime Inputs. Harness Input Sets are collections of runtime variables and values that can be provided to Pipelines before execution. You set up Input Sets for different Pipeline uses cases, and then simply select the Input Set you want to use at runtime.
Sometimes, the inputs and settings for all of the stages in a Pipeline aren't known before you deploy. Some inputs and settings can depend on the execution of the previous stages in the Pipeline.
For example, you might have an Approval step as part of the stage or Pipeline. Once the approval is received, you want to resume the next stage of the Pipeline execution by providing new inputs.
To do this, when you add certain stage settings to your Pipeline, use Runtime Inputs.
How Do Runtime Inputs Work?
You select Runtime Input as the option for a setting.
The Runtime Input is identified using the expression
When you run a Pipeline, you provide the value for the input.
You can enter a value for the variable or use a Harness expression.
Later, if you choose to rerun a Pipeline, the Pipeline will run using the Runtime Inputs you provided the last time it ran.
Use Runtime Inputs in a Stage or Pipeline
Using Runtime Inputs templates some or all of a stage or Pipeline's settings. The same Pipeline can be run using different values for all of the Runtime Inputs.
You can use Runtime Inputs in a CI stage's Infrastructure. Here's an example using a Runtime Input in the Namespace setting.
You can use Runtime Inputs for the Service in a CD stage's Service settings.
With Expressions you can use Harness input, output, and execution variables in a setting.
All of these variables represent settings and values in the Pipeline before and during execution.
When you select Expression, you type
<+ and a value and the list of available variables appears.
Simply click a variable name to use it as the value for this setting.
At runtime, Harness will replace the variable with the runtime value.