Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Identical tasks in plans, just the variables different - how best to implement?

We're using Bamboo to build Jekyll web sites from content in git repositories.

We've got develop & master branches, and staging & production web sites.

The tasks to build the web sites are identical for both - it is just the variables that change, to specify whether this is a staging build or a production build.

At the moment, I've got two separate plans - each with an identical set of tasks and slightly differing variables.

Is there a better way to do this? My concern is that I've got to keep the task configuration in sync and I'd prefer to try to have a "master" plan and then somehow specify the different variable values in order to generate the appropriate output.

Is that possible with Bamboo? Or am I thinking about this the "wrong" way?



2 answers

1 accepted

2 votes
Answer accepted

As long as you are only using long lived branches as outlined, you should be able to just use a single plan, create a manual plan branch, and then override the variables in the plan branch details configuration:


This approach seems to be working well. At the moment, the main plan is referencing the develop branch and I've created a plan branch for the master branch.

I'm toying with the idea of removing the repository from the main plan, so that it never directly triggers, and then adding the develop branch as a second plan branch. That seems to be more consistent than the way I've got it configured at the moment.

Just as a follow-up note, it is perfectly possible to remove the *trigger* from the main plan and add the develop branch as a second plan branch. It works well and BitBucket still recognises that a pull request against that branch is building even though the main plan isn't the one building it.

Thanks for the follow-up @Philip Colmer, using plan branches without the main plan is a neat approach I never even considered!

0 votes

You can also use Bamboo Specs which was released in Bamboo 6.0 and 6.1 to create Specs plans definition to provide a common definition and then create couple of separate plans which have different variables.  In this way you'll still have couple of separate plans but you won't need to have to keep them in sync since the definition will be generated by Bamboo Specs. 


Let's say:

public Stage getCommonStage(){
return new Stage() // configure here common parts of your plan

Plan prod = new Plan(...).stages(getCommonStage())
.variables(/*put variables here which are different for each plan*/)

Plan stage = new Plan(...).stages(getCommonStage())
.variables(/*put variable here which are different for each plan*/)

new BambooServer(...).publish(stage)
new BambooServer(...).publish(prod)

You can read more about Bamboo Specs here and here

Thanks, Grzegorz, for the suggestion. I decided to go with plan branches in the end because it was easier to get that solution in place and we don't have any Java programmers here. The documentation seems to suggest other languages can be used but it isn't clear how to adapt and I had some tight deadlines to hit.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

244 views 4 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you