Variable management

Updated at:

This document describes how to use variables to standardize and customize processes such as application releases and environment deployments. AppStack provides a variable management feature for application orchestration and environment deployment.

AppStack provides system variables you can reference directly. You can also create variable groups to manage custom variables. In application orchestration, you can extract environment-specific configurations into variables. By linking different environments to different variable groups, you can use a single orchestration template to deploy to multiple, distinct environments. Note: AppStack does not support injecting variables from other Alibaba Cloud DevOps sub-products or external systems.

Create a variable group

  1. In the variable group > New Variable to open the Create Variable Group dialog box.

    • Name: Required. The name must be 1 to 63 characters long and can contain only lowercase letters, digits, and hyphens (-). It cannot start or end with a hyphen.

    • Display name: Required. After creation, you can change this name by clicking Edit variable group. The display name must be 1 to 64 characters long and can contain Chinese and English characters, digits, or symbols.

    • Create from existing variable group: Optional. Select an existing variable group to populate the new group with its variables.

  2. Click OK to create the variable group. After creation, it appears in the variable group list on the left.

Edit a variable group

Select the variable group you want to edit and click Edit variable group to enter edit mode. You can add, modify, and delete variable key-value pairs.

Delete a variable group

You can delete a variable group only if it is not referenced by any environment. To do so, select the group and click Delete variable group. This action is irreversible.

Important

The variable group "k8s" cannot be deleted because it is in use.

Version history

AppStack supports version control for variables, allowing you to view the version history and compare different versions.

  • View version history

    • Version: The version number.

    • Revision log: The commit notes.

    • Commit message: Displays the Committer and Commit Time.

  • Version comparison: In the version list, select two versions to compare and click Compare.

    The Variable group version comparison dialog box appears. At the top, you can select the 'from' and 'to' versions. The left panel shows a list of changed variables with modification indicators, and the right panel displays the specific differences in a diff view.

System variables

In addition to custom variable groups, AppStack provides system variables that you can reference in various scenarios, such as application orchestration and environment deployment. The following table lists the available system variables.

Parameter

Type

Value

DATETIME

datetime

The current date and time, for example, 2021-05-04 00:00:00. Note: The value is evaluated at runtime, for example, during application orchestration.

TIMESTAMP

timestamp

The current timestamp, for example, 1620057600. Note: The value is evaluated at runtime, for example, during application orchestration.

APPSTACK_APP_NAME

string

The name of the current application, for example, myapp.

APPSTACK_COMPONENT_NAME

string

The name of the current orchestration component.

APPSTACK_ENV_NAME

string

The name of the current environment, for example, dev.