Creating a Generic bamboo specs for all Plans/Projects

Immanuel J Daniel December 4, 2019

Team,

I would like to understand the possibilities of creating a generic bamboo spec using java that can be used by all the Plans/Projects. This spec would contain all the common tasks templated/parameterised and be used by passing variables according to the plan/project.

Any reference or suggestion around this topic would be helpful.

1 answer

0 votes
Jimmy Seddon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 4, 2019

Hi @Immanuel J Daniel,

Welcome to the Community!

I did something similar to what you are talking about as a proof of concept for my company (we have since decided to move toward YAML specs instead).

Where I stated was I viewed/downloaded a copy of one of our plans as a reference point.  Then, I made three classes:

A publish class - which all it does is have a main method that creates instances of my "Build Plan" Class and publishes them to my Bamboo server

A utilities class - I made a second class that was simply a bunch of methods that would wrap the creating the various tasks I would need for all of my build plans so that I could use them as building blocks as needed, by passing in various pieces of required information and returning a object of the various task types. 

Multiple build plan classes - this contained members that would hold information unique to each build plan such as the name, the key and the linked repository, and I used that information to construct the strings that would be passed to the utilities methods to create the various tasks I wanted to use for the plan.

Now, I only every created one build plan class, but this setup allowed me to change the types of tasks that were being created based on what we needed the build plan to do.

I hope that helps as a starting point.

-Jimmy

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events