Resetting Variables via a REST API call and Dynamic Release versioning

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

Resetting Variables

Bamboo builds or deployment projects can be triggered externally using Bamboo's REST API (https://docs.atlassian.com/bamboo/REST/5.0-SNAPSHOT/), and variable values can be reset by bamboo.variable.myVariable=valueForMyVariable option as it's described here - https://docs.atlassian.com/bamboo/REST/5.0-SNAPSHOT/#d2e927. For example, if there is a plan variable definition (myVariable=valueOfMyVariable) in the plan that we want to trigger, we can change the value by passing it to the REST call:

curl -X POST --user admin:admin "http://localhost:8085/rest/api/latest/queue/PROJ-PLAN?executeAllStages=true&bamboo.variable.myVariable=newValue"

where the "admin:admin" is the username:Password of a Bamboo user; instead of "localhost", the correct Bamboo hostname should be used; "PROJ-PLAN" is the project and plan keys of the plan that we want to trigger; "variable" - this component is for the REST API call and must be present; "myVariable" is the name of the variable that we want to reset; "newValue" is the new value that we are passing to the plan.

ユースケース

Release version numbering in Deployment projects can be configured to use the custom variable values. In order to do that the plan can be triggered using the above mentioned curl command, and when the build result is ready, we can make a new Release for the Deployment environment and use the custom variable: release-${bamboo.myVariable}. When a new release is created, the version will look like: "release-newValue".

最終更新日: 2017 年 10 月 18 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.