vinod827
vinod827

Reputation: 1544

How to write a new Bamboo plan which gets build number from another Bamboo Plan?

I need write a new Bamboo plan which would run on an adhoc basis and eventually deploy specific version of artifact (specific build number to be precise) on specific targeted environment, for instance Test or QA environment. There is already an existing Bamboo plan which runs automatically (whenever PR gets approved and merged with master) and generates a specific version of docker image(specific build number) that gets deployed on Dev environment. Some how I need to share this specific build number (artifact version) across with my new Bamboo plan so that the new Bamboo need not have generate the artifact all over again but just search it from Artificatory (based on build number) and deploys on Test/QA environment. What is the best approach of keeping the build number? Like putting into global variables or write it into some files and read it from there.

Upvotes: 1

Views: 870

Answers (1)

Wesley Rolnick
Wesley Rolnick

Reputation: 891

You could:

  • Use a global variable. I've had trouble writing to these within jobs and have always had to script it. However, if all you need is the build number, you can access that from another plan.
  • Write the version number out to a file somewhere. Ideally somewhere protected or in source control. Make sure to make this a "Shared Artifact" so that the new Bamboo plan can pick it up. This approach may not be the "best" but it does get the job done.

Upvotes: 3

Related Questions