Specs - How to set custom plan branch for deployment project

Pedro Sa da costa January 13, 2020

Using Java specs, how can I set a custom plan branch for a deployment project?

In the UI this option is under `/deploy/config/configureDeploymentProjectDetails` .

 

If this is not possible, is it possible in any other way to mass configure different deployment plans for the same build plan  being ran on different branches?

 

Best Regards,

Pedro

 

1 answer

1 accepted

1 vote
Answer accepted
Alexey Chystoprudov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 14, 2020

Configure custom branch for deployment project through UI and then use menu item "View as Java Specs". It will generate Java code for current deployment project

Pedro Sa da costa January 14, 2020

Hello Alexey,

 

Thanks for the tip, I can see now that the PlanIdentifier ID number changes for each branch. This was not oblivious from the API. 

 

Thank you for your help!

Pedro Sa da costa January 14, 2020

After fiddling with this some more, this allows me to edit existing branches, but not to create new ones since I'm missing a BambooOid. Can this Id be retrieved somehow (using the API, or the GUI) from an existing build branch and not an existing deployment plan?

Alexey Chystoprudov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 14, 2020

It's enough to use PlanIdentifier without oid

final Deployment rootObject = new Deployment(new PlanIdentifier("COM", "PLAN10")), "Test")
Like Pedro Sa da costa likes this
Pedro Sa da costa January 14, 2020

Unfortunately that does not work for me when creating a new deployment:


val deploymentName = "Tomcat Alpha deployment ${env.name.toUpperCase()}"
val planIdentifier = PlanIdentifier(Vars.PROJECT_KEY, env.bambooPlanId)
Deployment(planIdentifier, deploymentName)


// error
//
// Can't find deployment project by oid(null) or name(Tomcat Alpha deployment TEST)

Vars.PROJECT_KEY,  and env.bambooPlanId match the IDs i can see in the bamboo plan generated java specs if I create it manually.

Alexey Chystoprudov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 14, 2020

This error message is from deployment permissions import.

Are you sure it's related to plan branches selection from topic header?

Like Pedro Sa da costa likes this
Pedro Sa da costa January 14, 2020

You are correct! 

The problem was indeed from the permissions import. I was doing them before publishing the specs, which would cause an error when creating , but not when updating an existing plan.

 

Thank you for your help!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events