开发者

Is it possible to share a single build number between plans of a Bamboo project?

I am using Atlassian Bamboo as my continuous integration server. For a project, I’ve defined two plans, namely development plan and release plan. Unfortunately, Bamboo uses two separate build numbers for each of these plans. This prevents me from identifying a build in the scope of a project by its build number. Is th开发者_JAVA技巧ere any way to share a single build number between all the build plans of a project in Bamboo?


Yes, there is a way (a workaround):

Use the plugin providet at this page: http://blogs.atlassian.com/2012/08/bamboo-maven-version-update-plugin. The plugin is named "Maven version updater for Bamboo variables", but does not require the use of Maven.

Follow the instructions in the above link to install the Bamboo plugin. Define a global variable in Bamboo, named e.g. "globalBuildNumberAutoupdate" with any number as the value (e.g. 1001). Then include a task (in your Bamboo build plan) using the above mentioned plugin, and set setting "Regex for matching Bamboo variables" to ".*Autoupdate", and remember to check "Include global variables when matching and updating".

Now you can use the variable ${bamboo.globalBuildNumberAutoupdate} in your builds (instead of ${bamboo.buildNumber} ).

This works nicely for us, using Atlassian Bamboo version 4.4.0.

Notice that the value for the global variable is "freezed" for the build during the execution of the Bamboo Plan. So all build steps in the same build plan will use the same value for the global variable, and they will use the value that the global variable had when the build was triggered. This also implies that the increased value will be used for the next build. But that's OK for us, as long as the value is increased for all builds.

I hope this helps! :-)


It seems that No. Each plan in Bamboo has its own counter and it is not possible to share a single build number among plans.


Create one plan, for example I am using a name TRUNK (because it corresponds to TRUNK in my SVN). And add stages to it: Release, Debug, Code-Analysis and whatever you want else.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜