简体   繁体   English

有没有办法在 Bamboo 中触发子计划并传递版本号等信息?

[英]Is there a way to trigger a child plan in Bamboo and pass it information like a version number?

We're using Go.Cd and transitioning to Bamboo .我们正在使用Go.Cd并过渡到Bamboo

One of the features we use in Go.Cd is value stream maps .我们在 Go.Cd 中使用的特性之一是 值 stream 映射 This enables triggering another pipeline and passing information (and build artifacts) to the downstream pipeline.这可以触发另一个管道并将信息(和构建工件)传递到下游管道。

This is valuable when an upstream build has a particular version number, and you want to pass that version number to the downstream build.当上游构建具有特定版本号并且您希望将该版本号传递给下游构建时,这很有价值。

I want to replicate this setup in Bamboo (without a plugin).我想在 Bamboo 中复制这个设置(没有插件)。

My question is: Is there a way to trigger a child plan in Bamboo and pass it information like a version number?我的问题是:有没有办法在 Bamboo 中触发子计划并传递版本号等信息?

This has three steps.这分为三个步骤。

  1. Use a parent plan/child plan to setup the relationship.使用父计划/子计划来建立关系。

  2. Using the artifacts tab, setup shared artifacts to transfer files of one plan to another.使用工件选项卡,设置共享工件以将一个计划的文件传输到另一个计划。

3a. 3a。 At the end of the parent build, dump the environment variables to a file在父构建结束时,将环境变量转储到文件中

env > env.txt

3b. 3b。 Setup (using the artifacts tab) an artifact selector that picks this up.设置(使用工件选项卡)一个工件选择器来选择它。

3c. 3c。 Setup a fetch for this artifact from the shared artifacts in the child plan.设置从子计划中的共享工件中获取此工件。

3d. 3d。 Using the Inject Variables task - read the env.txt file you have transferred over.使用Inject Variables 任务- 读取您传输过来的env.txt文件。 Now your build number from the original pipeline is now available in this downstream pipeline.现在,您可以在此下游管道中使用原始管道中的内部版本号。 (Just like Go.Cd). (就像 Go.Cd 一样)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM