Variables

Introduction

A variable is a placeholder value that can be defined at the job level or pipeline level as required. You cannot define a variable at the stage level.

You can define the required variables for the pipeline as key-value pairs using the variables key.

Properties of a Variable

Key Value is Mandatory
Variable Name Specify a string value for the variable Yes

YAML Code Snippet for Variable

You can declare a variable at the job level in the catalyst-pipelines.yaml file using the below syntax:

    
copy
variables: target:'app3.1'

Global Variables

You can define a variable at the pipeline level directly from the console. Refer to this help page to know the exact steps to create a variable.

Note:

You must mandatorily set a global variable named CATALYST_TOKEN and input the token generated from your Catalyst CLI, in case you have used Catalyst CLI in the pipeline execution. To fetch your token, please refer to the steps mentioned in this help section.

Access the Variable

A variable can be accessed by using any of the following methods:

  • « variables.{variable_name} » : This can be used to access any variable defined at the job level.

  • « event.{variable_name} » : This can be used to access any variables passed in the event JSON while triggering the pipeline manually from the console.

  • « env.{variable_name} » : This can be used to access variables defined in the pipeline level.

Last Updated 2025-05-30 16:54:59 +0530 +0530