问题
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