Bamboo create plan using add on

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
Accepted answer

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, 

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

2 votes
Accepted answer

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!"))));
}

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?

 

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.

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

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 

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?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published 4 hours ago in Confluence Cloud

Happy holidays from our team to yours!

Hi Community!  2018 was filled with changes for our team, both big and small, and we've taken a lot of time to both celebrate our wins and recognize areas of improvement. One thing that we're a...

74 views 0 9
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you