Available Environment Variables
Environment Variables (Env Vars) consist of a key and a value, as well as optional attributes. They can be defined on the level of apps, Workflows or Steps.
Environment Variables (Env Vars) consist of a key and a value. They can also include optional attributes. They can be defined on the level of apps, Workflows or Steps.
You can set your own Env Vars but there is a selection of Env Vars that are exposed automatically by either the Bitrise CLI or bitrise.io.
-
Env Vars exposed by the Bitrise CLI are available everywhere, even if you run the build on your own computer.
-
Env Vars exposed by bitrise.io are available for builds running on bitrise.io virtual machines.
-
Pipeline Env Vars exposed by bitrise.io are only available for Pipeline builds running on bitrise.io virtual machines.
In addition, plenty of Bitrise Steps export output variables. These variables are available to subsequent Steps during a build. You can find them in the Step configuration of each Step:
-
In the Workflow Editor, you can check them in the Output properties section of a Step.
-
In the
step.yml
of a Step, you can find them underoutputs
.
Release Management also passes a number of Env Vars to Bitrise builds: Table 4, “Environment Variables passed to the builds from Release Management”.
Environment Variables have a set availability order. This is the order in which they are made available as a build progresses: Availability order of Environment Variables.
Step outputs exposed as Env Vars
Steps can also expose Step outputs as Env Vars. For example, a Step that builds a binary can expose that binary to other Steps as an Env Var. As basically any Bitrise Step can expose outputs this way, we won't list them all but you can find all Environment Variables related to the git cloning process: Table 5, “Env Vars exposed by the Git Clone Repository Step”.
Env Var key |
Description |
---|---|
|
The ID of the Workflow that was triggered. This Env Var is exposed regardless of whether the Workflow was triggered manually or automatically. |
|
The title of the Workflow that was triggered. This Env Var is exposed regardless of whether the Workflow was triggered manually or automatically. |
|
The current status of the build. The available options are:
A successful current status means that none of the previous Steps in the build failed. |
|
Path to the base working directory. By default, it’s the directory where Bitrise runs, unless you provide a different value. This can be overwritten during the build, which will change the working directory for subsequent Steps in the build. |
|
Path to the directory that stores artifacts and files for deployment. It’s a temporary directory created by the Bitrise CLI by default, and can be overwritten before starting the Bitrise CLI. The Deploy to Bitrise.io Step looks for your build artifacts - such as an IPA or APK of the app -, test results, and other files in this directory. |
|
Root directory for all test results created by the Bitrise CLI. Test results placed in this directory can be accessed in the Test Reports add-on. |
|
Indicates whether the Bitrise CLI is running in Continuous Integration mode. The possible values are:
|
|
Indicates whether the Bitrise CLI is running in PR (Pull Request) mode. Running in Pull Request mode means that Bitrise builds your code in the state as if the Pull Request was already merged. The possible values are:
|
Env Var key |
Description |
---|---|
|
Build number of the build on bitrise.io. |
|
The title of your app on bitrise.io. You can change it any time on the Settings tab of the app. |
|
The URL or your app on bitrise.io. This is not the same as the git repository URL! An app URL has the following format:
For example: https://app.bitrise.io/app/31e481ce08e0xfd9. |
|
The slug that uniquely identifies your app on bitrise.io. It’s part of the app URL, too. |
|
The URL of the build on bitrise.io. |
|
The slug that uniquely identifies a build on bitrise.io. It’s part of the build URL, too. For example, let’s take a look at this build URL: https://app.bitrise.io/build/d75abbebxfc9ca4e. The build slug is |
|
The date and time when the build was triggered. |
|
The URL of the Git repository that hosts your app. This can be changed in the Settings tab of the app. It can be in either SSH or HTTPS format. |
|
The git branch that is built by Bitrise. For example, |
|
Used only with builds triggered by pull requests: the destination/target branch of the pull request that triggered the build. For example, a pull request wants to merge the content of a branch into the branch |
|
If a build is triggered by a Git Tag, this Env Var stores the tag used. |
|
The commit hash of the Git commit that triggered the build, when applicable. |
|
The commit message, pull request title, or the message you specified if you triggered the build manually. |
|
The owner of the Git repository of the app. |
|
The slug of the Git repository of the app. |
|
The ID of the pull request that triggered a build. |
|
The URL of the repository from where the pull request that triggered a build has been sent. |
|
The pre-merge branch - if the Git hosting provider supports and provides the pre-merged state of a pull request on a special merge branch. |
|
The pull request head branch, if the Git hosting provider system supports and provides this. This special git ref should point to the source of the pull request. |
|
For apps hosted on GitHub only: it is set to |
|
The URL of the Apple provisioning profiles uploaded to bitrise.io. If there is more than one provisioning profile uploaded for your app, a pipe character ( This is only relevant for iOS apps and for cross-platform apps with iOS versions. |
|
The URL of the Apple certificates uploaded to bitrise.io. If there is more than one certificate uploaded for your app, a pipe character ( This is only relevant for iOS apps and for cross-platform apps with iOS versions. |
|
The passphrase you set for the uploaded Apple certificates on the app’s Code Signing & Files tab. If there is more than one certificate with a passphrase, a pipe character ( This is only relevant for iOS apps and for cross-platform apps with iOS versions. |
|
Indicates that the build is running in a bitrise.io environment. Value is set to |
Env Var key |
Description |
---|---|
|
The ID of the running Pipeline build. This Env Var is exposed regardless of whether the Pipeline was triggered manually or automatically. |
|
The name of the running Pipeline build. This Env Var is exposed regardless of whether the Pipeline was triggered manually or automatically. |
|
The status of previously finished Stages and Workflows in a build. Please note that the value of this Env Var may change in the future! |
|
The current status of the Pipeline build. The value of this Env Var can be: |
|
The URL of the Pipeline build. |
Env Var key |
Description |
---|---|
|
The version of the binary (APK/AAB or IPA file) generated by the release candidate build. |
|
The download URL of the binary (APK/AAB or IPA file) generated by the release candidate build. |
|
Unique identifier of the binary (APK/AAB or IPA file) generated by the release candidate build. |
|
The release name (for Google Play releases) or version (for App Store releases) in Release Management. |
|
The build slug of the build that was selected as a release candidate for the release. |
Env Var key |
Description |
---|---|
|
The hash of the commit that the build uses (the cloned commit). |
|
The subject of the commit message of the cloned commit. |
|
The body (content) of the commit message of the cloned commit. |
|
The commit count of the cloned commit. This Env Var is influenced by the |
|
The name of the author of the cloned commit. |
|
The email of the author of the cloned commit. |
|
The name of the committer of the cloned commit. |
|
The email of the committer of the cloned commit. |