デプロイ変数
Bamboo manages a number of standard reserved variables that are available during deployment executions.
名前が繰り返される場合、次のリストで後にある変数が前の変数をオーバーライドします。
- グローバル変数
- 以下に定義されているリリース変数
- 環境レベルで定義されたユーザー変数
- 次の表の自動生成変数
| 変数 | 説明 |
|---|---|
| bamboo.agentID | The id of the agent that the deployment is executed on. |
| bamboo.agentWorkingDirectory | エージェントの作業ディレクトリへのパス。これは Bamboo の作業ディレクトリとは異なります。 |
| bamboo.build.working.directory | Bamboo の作業ディレクトリへのパスです。これはビルド計画とデプロイ プロジェクトの両方で使用されます。 |
| bamboo.deploy.environment | リリースがデプロイされる環境の名前。 |
| bamboo.deploy.project | デプロイ プロジェクトの名前。 |
| bamboo.deploy.rollback | デプロイされるリリースが置き換えられるリリースよりも古い場合に当てはまります。 |
bamboo.deploy.release bamboo.deploy.version | デプロイされているリリースの名前。「.release」と「.version」のいずれかを使用できます。どちらもデプロイされるリリースの名前を返します。 |
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.resultsUrl | The URL to the screen in Bamboo that dispays build results. |
For Bamboo variables to do with build plans, and releases, see Bamboo variables.
デプロイ環境の変数を設定する
デプロイ環境変数は、環境パネルの [その他の設定] セクションの一部として設定されます。
On this page:
環境変数を設定する手順は以下のとおりです。
- Open your deployment project and expand the relevant environment panel. In the Other settings section, click Variables:
- [変数] 画面の関連フィールドに有効なキーと値を入力します。
- Click on Add to add the variable scheme:
- You can remove unwanted variables by clicking the relevant dustbin icon on the right of the Variables screen.
- 戻るには、[Back to deployment project (デプロイ プロジェクトに戻る)] をクリックします。


28 Comments
Jeremy Goodwin
Jun 07, 2013Is there an equivalent to '${bamboo.build.working.directory} for a deployment?
#edit
Turns out it is the build working directory. While appreciating this is beta so documentation etc is going to be light, it would be helpful to state that it uses the same build variables when creating a deployment
Dennis Alberti
Jul 16, 2013Is there a way to use JIRA custom variables when a release is started out of JIRA with existing Build?
I see the custom variables in the build summary when i trigger a release out of JIRA, like
But i can't access the Variable with '${bamboo.jira.version}' for configuring release versioning in Bamboo
Anonymous
Jan 10, 2014In order to use the version number from your JIRA project, you have to release from within JIRA.
JIRA -> Project -> Versions -> Release. Then the JIRA variables will be transferred to Bamboo for deployment.
Barry Pitman
Jul 23, 2013I think that the "bamboo.deploy.release" should actually be "bamboo.deploy.version", and probably the same for "bamboo.deploy.release.previous". The variable "bamboo.deploy.release" doesn't resolve to anything in Bamboo 5.
Also, I am finding that URL resolved from "bamboo.resultsUrl" is something like this: https://<my server>/bamboo/browse/viewDeploymentResult.action?deploymentResultId=18874369. Following that URL results in an "Internal Server Error" with message:
James Dumay
Jul 25, 2013Thanks Barry. Ill get someone to take a look at this and fix it for 5.1
Anonymous
Jul 25, 2013Great call Barry! I've been tearing my hair out!
Anonymous
Aug 01, 2013Custom plan variables do not seem to resolve to their values consistently when generating a release. I have plan variables to store the major and minor versions separately, as our deploy scripts handle major and minor upgrades differently, and the variables only seem to resolve to their value half of the time when generating a new release. Funny thing is, the variables always seem to work right when I click preview on the Release Versioning page.
Casey Entzi
Aug 02, 2013I experienced the same problem but i assumed it was due to an automatic build vs a manual build, as the automatic build didn't seem to have access to the plan variables from the build but when I reran the build manually, and created another release, it worked..
Steven de Salas
Aug 21, 2013Casey, Anonymous,
I added the following ticket to track loss of plan variables in deployment for automated builds:
BAM-13644 - Getting issue details... STATUS
Ron Chan
Aug 29, 2013I am reiterating Dennis question:
"Is there a way to use JIRA custom variables when a release is started out of JIRA with existing Build?
I see the custom variables in the build summary when i trigger a release out of JIRA, like
But i can't access the Variable with '${bamboo.jira.version}' for configuring release versioning in Bamboo"
We're really excited to jump into Deployment Projects but this seems like a blocker to me.
Our desired setup:
- Commits generate auto-builds
- Release from a JIRA version (select 'existing build' option)
- Create deployment project using ${bamboo.jira.version}
So why isn't Bamboo picking up the version???
Ron Chan
Aug 29, 2013By the way, I've tried BAM-13644 - Getting issue details... STATUS by upgrading to Bamboo 5.1.0...still no luck!
James Dumay
Aug 30, 2013Thanks for commenting on the ticket Ron. I've asked our support team to contact you and get to the bottom of this problem.
Anonymous
Jan 10, 2014In order to use the version number from your JIRA project, you have to release from within JIRA.
JIRA -> Project -> Versions -> Release. Then the JIRA variables will be transferred to Bamboo for deployment.
Spot Support
Jan 11, 2014That response is incorrect because of BAM-13730 - Getting issue details... STATUS
Anonymous - You should know that it works instead of giving bad information.
Ron Chan
Aug 30, 2013Thank you James.
user-055e6
Nov 20, 2013Is there a way to send variables from custom builds to deployments in Bamboo 5.2? We need to be able to send username and password that were used in a build to a deployment for ssh and ftp deployment tasks.
user-055e6
Nov 20, 2013After setting up a deployment it looks like the plan variables are being passed to the deployment. This is great!
Ron Chan
Nov 22, 2013Nathan, what changes did you make to the page? Was it screenshots for new functionality or just documentation cleanup?
By the way, the deployment variables still doesn't work for me, BAM-13730. So JIRA is used to trigger release builds, values are not being passed to the bamboo deployment projects. Has anyone encountered this or has any workaround???
Ron Chan
Nov 22, 2013I would really appreciate if someone from Atlassian could provide me with an update or at least a response to this?
To sum up, here's the issue:
According to documentation, this should work but it has not. I've tested 5.1, 5.2 and the latest 5.2.2. Can someone help???
user-055e6
Nov 20, 2013This is a more of a request than it is a bug I think. When overriding variables of type password, the input type is text and you are able to see the password as the user types. Can we change it so that any password variables that are overridden have an input of type password? Thanks
user-055e6
Nov 20, 2013And to go along with that change can we add a flag to variables that marks them as required to be overridden? That way when a user clicks run they automatically get a modal that pops to override the required variables.
ArmenA
Nov 22, 2013Patrick,
Bamboo currently doesn't have a feature for flagging variables to be mandatory to override. We are tracking a similar request here - BAM-12514 - Getting issue details... STATUS .
I raised an improvement - BAM-14050 - Getting issue details... STATUS .
Armen
Ladislav Gatial
Jan 11, 2014is it possible to use bamboo.repository.revision.number variable in release name in deployment projects feature? it is not working in my Version of bamboo 5.2.
bamboo.buildNumber variable is resolved fine, but the revision variable is not working...
ArmenA
Jan 13, 2014Hi Ladislav,
The bamboo.repository.revision.number variable is missing from the list of variables on the current page. Hence it's not available. You might be interested in trying the method described on this page - Resetting Variables via a REST API call and Dynamic Release versioning.
Armen
Andrew Heald
Jan 22, 2014It doesn't seem to be possible to set up deploy variables that can be overridden at deploy time. Have I missed something?
The scenario here is that we have a deployment that needs an optional database drop. Some deploys will, some won't. I could do with having the deployment person be prompted. Any ideas, please?
Thanks,
Andrew.
James Dumay
Jan 22, 2014It can't be done today. For the moment I would suggest making your deployment script intelligent enough to know if it needs to drop the db or not during the deployment process.
We have an open ticket for parameterised deployments but it is not on our roadmap:
BAM-13707 - Getting issue details... STATUS
John Sposato
May 14, 2014In Bamboo 5.4.2 build 4208, it seems these variables for scripts (SSH task anyway) aren't referenced as the documentation mentions. You can't use $BAMBOO_VARIABLE, you have to use ${bamboo.variable}. Some examples in some of the tasks might help. By that, I mean an example SSH/SCP task with a plan variable that was defined...
Bastien THORAL
May 15, 2014Hello, I have also a need to use autogenerated variables in a powershell deployment script. I easily used $Env:bamboo_XXXX for my variables but it doesn't seem to work for autogenerated. I add them to the command line with a "-D" but I would be so better to access them directly. Any idea
Thank you.