Variables for Universal Connector
Types of variables
This section describes the following types of variables:
- Azure DevOps variable group and pipeline variables
- GitHub Actions Variable, Secrets, and Workflow variable
- GitLab CI/CD variables
- Internal application variables
- Plug-in file-based variables
Azure DevOps variable group and pipeline variables
These variables are in VARIABLE format. The variable name is in uppercase.
SQL Assurancereplaces these variables with the default or user-defined value of the corresponding variable name.
To create variable group variables
- On the Azure DevOps dashboard, click Pipelines to expand it.
- Click Library.
- Click +Variable group.
- Enter the variable group name.
- (Optional) Enter a description.
- Click +Add.
- Enter a variable name.
Enter a variable value.
- Click Save.
To create pipeline variables
- On the Azure DevOps dashboard, click Pipelines to expand it.
- On the Pipelines tab, click All to show a list of all the pipelines.
- Select a pipeline to open a list of all runs for the specified pipeline.
- On the Runs tab, click Edit in the upper right-hand corner to edit the pipeline before running.
- Click Variables in the upper right-hand corner.
- In the Variables dialog box, click + Add.
- In the New variable dialog box, enter the variable name.
Enter a variable value.
- Click OK .
- Click Save.
GitHub Actions Variable, Secrets, and Workflow variable
These variables are in VARIABLE format. The variable name is in all caps.
SQL Assurancereplaces 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:
- In your GitHub repository, select Settings.
- Under Security, expand Secrets and Variables.
- Select Actions.
- Select the Variables tab and click New repository variable.
- Enter the variable name and value, and click Add variable.
To create secrets for use with multiple workflows:
- In your GitHub repository, select Settings.
- Under Security, expand Secrets and Variables.
- Select Actions.
- Select the Secrets tab and click New repository secret .
- Enter the secret variable name and value, and click Add secret.
To create environment variables for a single workflow:
- In your workflow scripts, define the key: env: .
- Under env:, define variableName: value.
GitLab CI/CD variables
These variables are in VARIABLE format and are all uppercase. SQL Assurance replaces these variables with the user-defined value of the corresponding variable name. You can use these variables to reuse the same property values in multiple pipelines or change the property value frequently.
GitLab provides predefined CI/CD variables for use in your pipeline configuration and job script. You can use these without declaring them first in your pipeline YAML file.
For more information on all GitLab CI/CD variable types, see the GitLab documentation.
To create variables for use with multiple pipelines
For variables referenced in the config yaml file and those with sensitive values, follow these steps:
- From the GitLab Project Settings menu, select CI/CD.
- Expand Variables.
- Click Add variable.
- Specify the following variable options:
- Type: Variable (default)
- Environment: All (default)
- Visibility: Select visible, masked, or masked & hidden, depending on the sensitivity of your variable value
- Flags: Expand variable reference
- Description: Enter a description of the variable.
- Key: Specify your variable name.
- Value: Enter a variable value.
Click Add variable.
To create pipeline variables for use in a single pipeline
For variables referenced in the pipeline YAML file, follow these steps:
- In your pipeline script, define the key: variables.
- Define the variable name under the variables keyword by indenting the variableName: and "value".
Internal application variables
These variables are in ${variable} format.
SQL Assurancereplaces these variables with the value of the corresponding fields. They are for internal application use only. Do not alter them.
Plug-in file-based variables
These variables are in $[variable] format.
SQL Assurancereplaces these variables with the value of the corresponding variable in the plug-in variables file (default file name: AMI_DevOps.properties).