Variables for Universal Connector


(BMC.DB2.SPE2304)

You can use variables to dynamically provide input for BMC AMI DevOps steps.

You can specify user-defined variables in one of the following formats:

  • VARIABLE
  • ${variable}
  • $[variable]


Types of variables

This section describes the following types of variables:

Azure DevOps variable group and pipeline variables

These variables are in VARIABLE format.  The variable name is in all caps.

BMC AMI DevOps replaces these variables with the default or user-defined value of the corresponding variable name.

Example

You can create a variable group which can have several variables defined to it, like USER_ID, with a default value, TESTER1. When you run the pipeline, the value of the variable, USER_ID, uses TESTER1.
You can create a pipeline variable, JOB_ID, with a default value, MME12345. When you run the pipeline, the value of the pipeline variable, JOB_ID, is either MME12345 (the default value of the JOB_ID parameter) or the value that you enter.

To create variable group variables:

  1. On the Azure DevOps dashboard, click Pipelines to expand it.
  2. Click Library.
  3. Click +Variable group.
  4. Enter the variable group name.
  5. (Optional) Enter a description.
  6. Click +Add.
  7. Enter a variable name.

    Enter the variable name in all caps to distinguish it from the actual value in the config YAML file.

  8. Enter a variable value.

    Important

    If this is a password, select the Keep this value secret check box.

  9. Click Save.

To create pipeline variables:

  1. On the Azure DevOps dashboard, click Pipelines to expand it.
  2. On the Pipelines tab, click All to show a list of all the pipelines.
  3. Select a pipeline to open a list of all runs for the specified pipeline.
  4. On the Runs tab, click Edit in the upper right-hand corner to edit the pipeline before running.
  5. Click Variables in the upper right-hand corner.
    1. In the Variables dialog box, click +Add.
    2. In the New variable dialog box, enter the variable name.
    3. Enter a variable value.

      Important

      If this is a password, select the Keep this value secret check box.

      If this is a value that will be replaced with each run, select the Let users override this value when running this pipeline check box.

  6. Click OK.
  7. Click Save.

GitHub Actions Variable, Secrets, and Workflow variable

(BMC.DB2.SPE2307)

These variables are in VARIABLE format. The variable name is in all caps.

BMC AMI DevOps replaces these variables with the default or user-defined value of the corresponding variable name.

The utilization of secrets and variables is useful if you want to reuse the same property values in multiple workflows or change the property value frequently.

To create variables for use with multiple workflows:

  1. In your GitHub repository, select Settings.
  2. Under Security, expand Secrets and Variables.
  3. Select Actions.
  4. Select the Variables tab and click New repository variable.
  5. Enter the variable name and value, and click Add variable.

To create secrets for use with multiple workflows:

  1. In your GitHub repository, select Settings.
  2. Under Security, expand Secrets and Variables.
  3. Select Actions.
  4. Select the Secrets tab and click New repository secret.
  5. Enter the secret variable name and value, and click Add secret.

To create environment variables for a single workflow:

  1. In your workflow scripts, define the key: env:.
  2. Under env:, define variableName: value.

    Example

    env:
       JOB_ID: Job0001

Best practice

We recommend that you define the variable and secret name in all caps to distinguish them from an actual value in the config YAML file.

Internal application variables

These variables are in ${variable} format.

BMC AMI DevOps replaces these variables with the value of the corresponding fields. They are for internal application use only. Do not alter them.

Example

The value of the symbolic variable, ${Job Card}, is the value of the field, Job Card.

Plug-in file-based variables

These variables are in $[variable] format.

BMC AMI DevOps replaces these variables with the value of the corresponding variable in the plug-in variables file (default file name: AMI_DevOps.properties).

Example

The value of the symbolic variable, $[acctno], is the value of the variable, acctno, in the plug-in variables file.

Important

  • (BMC.DB2.SPE2310)BMC AMI DevOps converts the $[variable] format into #variable# format and then searches for variable values in the plug-in variables file.
  • The variables provided in the samples are not keywords. You can use any variable name in the plug-in variables file and subsequently in the config YAML file.
  • If required, you can add more symbolic variables to your config YAML file.
  • You can delete symbolic variables from the config YAML file and hard-code values. However, we do not recommend this because it prevents you from dynamically providing values for your pipeline or workflow.
  • When you create a variable for a Linux directory path, the path value requires a backslash (\) escape character before each forward slash (/) path separator (for example, Azure\/SMPE\/PropertiesFiles\/AMI_DevOps.properties).
  • When you create a variable with one of these special characters in the ($,&) value, the value requires a backslash (\) escape character before either of the special characters (for example, DB\$123, TBL\&A). This is applicable to the 'password' key-value as well.
  • (BMC.DB2.SPE2310)Variable names of all types must be unique.
  • (BMC.DB2.SPE2310)Do not use any property key name as a variable name (for example, SSID).

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*