Programmable bamboo plans

I am currently trying to automate the release process using bamboo. There are 5 projects in the release, each of which is an optional candidate. Thus, the release can only be 1/5 of the projects, so I would not want to release all 5 projects every time.

I can use bamboo variables to choose which of the 5 projects should be released, however I am struggling to find a fuzzy way to create and deploy the candidates I want.

The process should work like this:

  • The release starts in the parent plan

    Various git tags and forks are done with a script task.

  • The generated child assemblies of the selected projects (? / 5) are built using a Maven build step that generates artifacts.

  • Plans for creating child plans. Deployment plans and candidate artifacts are deployed.

I'm scared at point 2 to define some kind of logic that selectively builds children's plans.

I have considered making blockers for unnecessary candidates so that they don't get triggered and programmatically inject requirements using bamboo variables into plans so that no agents can run unwanted plans. However, these approaches are somewhat hacky and terrible.

If there is a way or approach I missed, I would be extremely grateful for that!

+3


source to share


1 answer


So how do you do it:

1 Project
6 Build
plans 5 Deployment plans

1 The build plan contains a script that consumes the config set when the build starts. A simple script evaluates which projects should be released.

You can create a remote branch in each project repository and force each plan to look for new repositories using:

curl -s -X POST --user BAMBOOUSER:BAMBOOUSERPASSWORD 'https://bamboo.aws.co.uk/chain/admin/detectBranches.action?planKey=#{planKey}'  

      



Then you need to get the branch plan key for the newly created branch. This will give you a list of keys that you can parse:

curl -s -X GET --user BAMMBOOUSER:BAMBOOUSERPASSWORD 'https://bamboo.aws.co.uk/rest/api/latest/plan/#{planKey}/branch.json'

      

Create each candidate repository and set up a deployment project for each.

Not perfect, wish I had just used Jenkins to be honest.

+2


source







All Articles