Going to be switching to newer build servers and want to be able to setup the new machine, and bamboo build agents then assign every build thats done on machine1 to machine2.
I am using a custom key like agent name ='machine name" so it would be a bulk change of agent name,etc.
Hello there.
Thanks for your question that might also be interesting for other Bamboo users.
Let me start with a general overview of Bamboo's agent assignment options.
Dynamic assignment works via setting an agent capability and specifying the appropriate reqirement in a build plan's job. Effectively a requirement can be regarded as a must-have capability of a build plan on job level. If both match for one agent, that agent can be selected by Bamboo Server to run that build's job.
Find this process outlined in the following KB:
https://confluence.atlassian.com/bamboo/about-capabilities-and-requirements-289277171.html
Alternetively, Bamboo offers the option to explicitly dedicating an agent, be it local, remote or even elastic, to a build project, plan or job. This represents a fixed assignment. Find the below KB as a great reference for doing so.
https://confluence.atlassian.com/bamboo/dedicating-an-agent-629015108.html
Clearly, you can combine both strategies so to permit best and most flexible usage of your agent pool for your build plans, jobs and tasks. That said, when adding new agents which are supposed to run builds, you can utilize the above simply via Bamboo's UI.
Now we understand that you'd like to automatize agent switching from old to new agents. One sleek way of doing so using Bamboo UI might be the following:
The above approach should help you replace old by new agents with little effort.
With regards to "configuration per code", you may consider defining requirements for a build plan's job or task within its Bamboo Java or YAML Specs. Find this illustrated, also per examples, in section "Requirements" of KB
https://docs.atlassian.com/bamboo-specs-docs/7.0.2/specs.html?yaml#requirements
Besides, Bamboo's REST API allows to dedicate a build project, plan or job to an agent per the following endpoint
/agent/assignment?executorType&executorId&assignmentType&entityId
using the POST method. The DELETE method may be used to remove a dedication and per GET you can query for existing ones.
For deployment environments exist basically the same, though using two different REST endpoints for that.
Please find all REST details in our
https://docs.atlassian.com/atlassian-bamboo/REST/6.8.1/
Hope this helps. Please let us know if there is more that we can assist you on.
Thanks and cheers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.