Back to Top

Deploying the Same Set of Files to Multiple Servers Using Server Roles in BuildMaster

BuildMaster is designed to reliably and repeatably deploy files to any number of servers. The main feature used to accomplish the task of deploying the same set of files to multiple servers is “Server Roles”.

Step 1: Add a Server Role

Visit the Administration link in the top navigation menu, then select Server Roles under Infrastructure:

From the Server Roles page, click the Create Server Role button after the list of server roles. Server roles consist of a Name and a list of Servers.

Once you have created a server role, it can be used in plans and pipelines to refer to all servers in that role.

Step 2: Use the Server Role in a Plan

One of the ways server roles can be used in plans is a Loop block. Loop blocks run the same section of a plan repeatedly, once for each item in a list. Inside the loop block, you can use any operations and statements you would normally use in a plan. For this example, we will use the Ensure ProGet Package operation, but any other method of deploying files would work just as well.

Loops normally operate sequentially, with each item in the list waiting to start until all previous items are completed. However, we can use a General block with Asynchronously execute enabled to run the deployment on all the servers at the same time. The loop will not wait for the asynchronous blocks to complete before going to the next server in the role, so the ProGet package will be deployed to all of the servers in parallel.

Although a deployment will wait for any asynchronous blocks to complete before it ends, a deployment can have operations that need to run after the files are in place. Wait for asynchronous operations to complete causes the execution of the plan to pause until the asynchronous blocks finish. If there are asynchronous blocks earlier in the plan that can continue running after the files are in place, the plan can sometimes run faster if a token is used so that it only waits for the files. Tokens can be given any name, as long as the asynchronous block uses the same token as the wait operation.

Edit Loop Block (BuildMaster Visual Editor) BuildMaster Visual Editor OtterScript example BuildMaster Visual Editor OtterScript example

Server roles provide the advantage of not needing to update every plan when a server is added to or removed from a role. Adding a new web server or removing a retired database server can be done by updating the role, and future deployments will automatically use the new list of servers when executing.