Variables for deployment environments

Deployment variables

Bamboo manages a number of standard reserved variables that are available when deploying a project. 

Variables later in the following list override the previous ones in case of repeating names:

  • global variables
  • project variables of the plan linked to the deployment project
  • plan variables of the plan linked to the deployment project
  • release variables as defined below
  • user variables defined at the environment level
  • the autogenerated variables in the following table:
VariableDescription
bamboo.agentIdThe id of the agent that the deployment is executed on.
bamboo.agentWorkingDirectoryThe path to the working directory on the agent. This is not the same as the Bamboo working directory.
bamboo.build.working.directoryThe path to the working directory for Bamboo. This is used by both the build plan and the deployment project.
bamboo.deploy.environmentThe name of the environment that the release is to be deployed to.
bamboo.deploy.projectThe name of the deployment project.
bamboo.deploy.rollbackTrue if the release being deployed is older than the release being replaced.

bamboo.deploy.release

bamboo.deploy.version

The name of the release that is being deployed. Either .release or .version can be used. Both return the name of the release being deployed.

bamboo.deploy.release.previous

bamboo.deploy.version.previous

The name of the release that is being replaced (if available). Either .release or .version can be used. Both return the name of the release being replaced.
bamboo.resultsUrlThe URL to the screen in Bamboo that displays build results.
bamboo.triggerReason.key

The trigger key that caused the deployment to launch. For example:

com.atlassian.bamboo.plugin
.
system.triggerReason
:ManualBuildTriggerReason

For Bamboo variables to do with build plans, and releases, see Bamboo variables.

Configuring variables for deployment environments

Deployment environment variables are configured as part of the Other environment settings section of the environment panel.

To configure an environment variable:

  1. Open your deployment project and expand the relevant environment panel. In the Other environment settings section select Variables.
  2. Enter a valid key and value into the relevant fields in the Variables screen.
  3. Select Add to add the variable scheme.
    Edit environment variables screen
  4. You can remove unwanted variables by selecting the relevant cross icon next to variables.
  5. Select Back to deployment project to return.
Last modified on Jul 10, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.