Environments¶
Environment variables allow you to customize your native builds by providing configuration values, secrets, and other data that can be accessed during the build process. Capawesome Cloud provides several types of environment variables to support different use cases.
Default Environment¶
The following environment variables are automatically set by Capawesome Cloud for every build. These variables provide information about the build context and cannot be overridden.
| Name | Type | Description |
|---|---|---|
CI |
boolean |
Indicates the build is running in a CI environment (always true). |
CI_APP_ID |
string |
The ID of the application. |
CI_BUILD_ID |
string |
Unique identifier for the build. |
CI_BUILD_NUMBER |
string |
Sequential number of the build. |
CI_GIT_COMMIT_SHA |
string |
The SHA hash of the Git commit. |
CI_GIT_COMMIT_MESSAGE |
string |
The commit message of the Git commit. |
CI_GIT_REFERENCE |
string |
The Git branch or tag name. |
CI_PLATFORM |
string |
The target platform (ios or android). |
You can use these default environment variables in your build scripts to access information about the build context and make decisions based on that data.
Reserved Environment¶
The following environment variables are reserved for platform-specific build configuration. These variables can be set by you to customize the build process.
| Name | Type | Description |
|---|---|---|
ANDROID_BUILD_TYPE |
string |
The Android build type. |
ANDROID_FLAVOR |
string |
The Android product flavor. |
IOS_SCHEME |
string |
The iOS scheme name. |
NODE_VERSION |
int |
The Node.js version (must be the major version number such as 22 or 24). |
JAVA_VERSION |
int |
The Java version (must be the major version number such as 17 or 21). |
XCODE_VERSION |
int |
The Xcode version (must be the major version number such as 16 or 26). |
For example, you can set the JAVA_VERSION variable to 17 to use Java 17 for your Android builds, or set the IOS_SCHEME variable to specify a custom scheme for your iOS builds.
Build Stack
The available build stacks and their supported versions for Node.js, Java, and Xcode can be found in the Build Stacks documentation.
Custom Environments¶
Custom environments allow you to define sets of environment variables for different build scenarios. For example, you can create separate environments for development, staging, and production builds, each with their own configuration values.
To create a custom environment, navigate to the Environments page in the Capawesome Cloud Console and define your environment variables. You can then select which environment to use when triggering a build.
Reserved Variable Names
The environment variable CI and any variable starting with CI_ are reserved for CI-related functionality and cannot be overridden by custom environments. If you attempt to set a variable with a reserved name, it will be skipped and a message will be logged during the build process.
Secrets¶
Secrets are encrypted environment variables that are used to store sensitive information such as API keys, certificates, and passwords. Unlike regular environment variables, secrets are encrypted at rest and in transit, and their values are never displayed in build logs.
Add Secret¶
To add a secret, navigate to the Environments page in the Capawesome Cloud Console, click on "Manage Secrets" in the "Actions" menu of an environment, and create a new secret. Secrets can be accessed in your build scripts using standard environment variable syntax, just like regular variables.
Delete Secret¶
To delete a secret, navigate to the Environments page in the Capawesome Cloud Console, click on "Manage Secrets" in the "Actions" menu of an environment. From there, click on "Delete" in the "Actions" menu of the secret you wish to delete, and confirm the deletion.
Variables¶
Variables are regular environment variables that can be used to store non-sensitive configuration values. Variables are useful for storing values that may change between builds or environments, such as API endpoints, feature flags, or version numbers.
Add Variable¶
To add a variable, navigate to the Environments page in the Capawesome Cloud Console, click on "Manage Variables" in the "Actions" menu of an environment, and create a new variable. Variables can be accessed in your build scripts using standard environment variable syntax.
Delete Variable¶
To delete a variable, navigate to the Environments page in the Capawesome Cloud Console, click on "Manage Variables" in the "Actions" menu of an environment. From there, click on "Delete" in the "Actions" menu of the variable you wish to delete, and confirm the deletion.
Ad-hoc Environments¶
Ad-hoc environment variables are temporary variables that can be set when creating a build. Unlike custom environments, these variables are not persisted and only apply to the specific build being created.
Ad-hoc environments are particularly useful for:
- Troubleshooting and testing: Quickly test different configurations or build tool versions (e.g., setting
NODE_VERSIONto test a different Node.js version) without creating a new environment. - Native configuration overrides: Override native configuration values like version names or build numbers (see Native Configurations for more details).
Sensitive Data
Ad-hoc environment variables are not encrypted and may be visible in build logs. Avoid using ad-hoc variables for sensitive information such as API keys or passwords. Instead, use secrets in custom environments for sensitive data.
To use ad-hoc environment variables, specify them when creating a build through the Capawesome Cloud Console or API. These variables follow the same naming conventions and restrictions as custom environment variables, including the reservation of CI and CI_ prefixed names.
Add Variable¶
To add an ad-hoc variable when creating a build, navigate to the Builds page in the Capawesome Cloud Console and click on "Build from Git". In the build creation dialog, enter your ad-hoc environment variables in the "Ad-hoc Environment" input field. You can add multiple variables by pressing "Enter" after each variable. Each variable must be in the format KEY=VALUE.