Bamboo Atlassian:如何在阶段之间共享变量 [英] Bamboo Atlassian: How to share a variable between stages

查看:298
本文介绍了Bamboo Atlassian:如何在阶段之间共享变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对竹子来说还比较陌生.我有一个关于使用共享变量执行阶段的问题.我有两个阶段:

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

阶段1: 设置变量"Sample_build_number"

Stage 1: Set variable "Sample_build_number"

阶段2: 使用变量"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

在第2阶段的工作中,使用注入Bamboo变量任务以读取属性文件.

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

您的变量在以后的工作步骤中以${bamboo.inject.Sample_build_number}

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

请注意,这使用 Bamboo Inject Variables Plugin (捆绑在5.7版及更高版本中).如果您使用的是Bamboo的早期版本,则管理员需要下载并安装该插件.

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.

这篇关于Bamboo Atlassian:如何在阶段之间共享变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆