Configuring an Environment Variable
Background
You can use ${variable name} to reference an environment variable when creating or editing a release policy, or use {{variable name}} to reference an environment variable in YAML files. Environment variables include:
- Custom variables: can be added as needed. Currently, only variables of the string type are supported.
- Default variables: system parameters, which cannot be deleted or modified. Default variables include ARTIFACT, TIMESTAMP, and PROJECT_ID.
Configuring a Variable
- Log in to CodeArts.
- Click a project name to access the project.
- Choose CICD > Release to access the environment list page.
- Click an environment name, the Environment Information tab is displayed. Switch to the Environment Variable tab.
- Click Edit Variable to add a variable and set parameters.
Parameter
Description
Variable
Variable name, which can be customized.
Type
Only the string type is supported.
Value
The current value of a variable, or empty if you are adding a new variable.
Change Value
Set a new variable value here if you are editing a variable.
Description
The description of a variable.
Private Variable
If a parameter is private, the system encrypts the parameter for storage and decrypts the parameter for usage. Private parameters will not be displayed in run logs.
Operation
Click
in the Operation column to delete a variable.
You can also add, modify, and delete variables as required.
- After setting all parameters, click Save.
- Confirm the information on the dialog box that is displayed, enter the remarks, and click OK.
Historical Version
- Click a version name to view the variable details.
- Click
in the Operation column to compare the current version with a specified version.
Using a Variable
You can use environment variables in the following scenarios:
- When creating or editing a release policy, you can use ${variable name} to reference an environment variable in the YAML path, for example, the workload YAML path in the rolling upgrade task.
- Use {{variable name}} to reference an environment variable in the YAML configuration file associated with the release policy.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot