Bamboo create plan using add on

Neil_Beukes June 1, 2017

Hi, i am using a trial of the Bob swift CLI to automate the creation of plans. but that tool is really expensive and im only using one of its commands. Thus a feels like a waste at that price. The API does not support the creation of plans so the only other option is creating my own Add On. Any pointers on this please how it can be done and whether it is possible and even worth it? 

Thanks in advance

2 answers

2 accepted

2 votes
Answer accepted
Steffen Opel _Utoolity_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 1, 2017

While you could certainly achieve this by developing a Bamboo add-on, I think it is not worth the effort anymore, given the new Bamboo Specs are readily available in Bamboo 6 to programmatically create (and maintain) plans via configuration as code:

Configuration as code is now available in Bamboo! You can start storing your build plan configuration as code for easier automation, change tracking, validation, and much more. Read all about other benefits of using configuration as code in Bamboo Specs. We've also prepared a tutorial that will help you create a simple plan in no time. For behind-the-scenes information about the Bamboo Specs library, see our detailed reference documentation.

Here's an example (the Bamboo Specs reference has more details):

private Plan createPlan() {
    return new Plan(
            project(),
            "Plan Name", "PLANKEY")
            .description("Plan created from (enter repository url of your plan)")
            .stages(
                    new Stage("Stage 1")
                            .jobs(new Job("Run", "RUN")
                                    .tasks(
                                            new ScriptTask().inlineBody("echo Hello world!"))));
}
Neil_Beukes June 1, 2017

thanks for your answer aswell, will defnitely try it out. one last question can specs be used to create a new project in bamboo?

So to get it straight, specs can be used in an external program such as java and contact a bamboo instance on your network?

 

Steffen Opel _Utoolity_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 1, 2017

Can specs be used to create a new project in bamboo?

Certainly, have a look at the Project reference.

Specs can be used in an external program such as java and contact a bamboo instance on your network?

Yes, that's in fact the main operation modus right now - for example, if you create a Bamboo Specs progam via a Maven archetype as per the tutorial, you will get an executable Java program that does just that.

Neil_Beukes June 1, 2017

Awesome, maven is perfect, ill post back if i have any more questions, thanks so much for quick responses.

Neil_Beukes June 2, 2017

Morning Steffen,

So i followed the tutorial and bamboo specs is great ! thanks so much for the suggestion. one last thing in the documentation it says a plan can do this :

"Specifies who has permission to view and configure the plan and its jobs."

but i cant seem to find this functionality in the methods that plan has. Do you have any knowledge whether its possible to give a specific user/users access to this newly created plan/project using specs?

Regards 

Steffen Opel _Utoolity_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 2, 2017

Good catch, hadn't realized that phrase yet - given the Bamboo Specs API reference has no notion of permissions either as of release 6.0.1, I'm afraid that's one of the still not supported aspects, like notifications and deployment projects.

And now that I state this, I seem to recall that permissions have indeed been mentioned to be missing still at Summit Europe 2017, maybe Piotr can conmment on this and a resp. ETA?

2 votes
Answer accepted
Piotr Swiecicki
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 1, 2017

Take a look at Bamboo Specs released in Bamboo 6.0, I believe this is what you are looking for.  It allows you to represent your plans as a code and submit that code to a running Bamboo instance to get your plan created/updated.  

Hope that helps, 

Neil_Beukes June 1, 2017

thanks for your awnser. can specs be used to create a new project in bamboo? 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events