Bamboo Atlassian: How to share a variable between stages

风格不统一 提交于 2019-12-12 18:08:31

问题


I am relatively new to Bamboo. I have a question regarding stages implementation with shared variable. I have two stages:

Stage 1: Set variable "Sample_build_number"

Stage 2: Use variable "Sample_build_number"

Any help with this is very much appreciated.


回答1:


You can write your variables to a simple property file in Stage 1, and share the property file as an artifact.

Sample_build_number=myvalue

In your Stage 2 job use the Inject Bamboo variables task to read the property file.

Your variable is available in later job steps as ${bamboo.inject.Sample_build_number}

Note this uses the Bamboo Inject Variables Plugin that is bundled in versions 5.7 and later. If you have an earlier version of Bamboo your administrator will need to download and install the plugin.



来源:https://stackoverflow.com/questions/39628171/bamboo-atlassian-how-to-share-a-variable-between-stages

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!