How to best automate BuildAgent installation?

I have a system which is going to have a few build machines. Not enough of them to warrant something as elaborate as terraform, but enough to be tedious by hand.

I've decided to automate the system by writing a Powershell script that would need to be ran on the system once and have it up and ready when it's done.

The script is quite simple for the most part - it just runs a bunch of msi/exe installers (Notepad++, p4v and friends, VS build tools, x64 debuggers and tools and UE4Prerequisites to be precise). The only thing left remaining is the actual build agent.

For that, I have two choices: Exe installer or Zipped agent. Technically, there is also agent push, but that is initiated from the TC server, not the agent itself, which goes against the general idea here.

Exe installer is quite straightforward - you run it, enter configuration details when prompted and voila, everything is setup.
Zipped agent is more complicated - You have to extract it and manually setup a bunch of stuff - setting folder permission, registering services, installing java, etc.

What I would like most is to provide the installer with the parameters on the command line and have it run without any user input - the final step where properties are setup can be skipped - I'd edit that file directly and start the agent using the .bat file. However, there is not way to automate .exe installer, at least to my knowledge. I hope somebody can prove me wrong on that account.

The only alternative is the zipped agent which I dislike since it's so many manual steps with so much room for error. It certainly can be done, but I'd rather not if possible.

Or perhaps someone has a better idea altogether?

0
1 comment
Hi,

Agent Push is best suited for the centralized installation of build agents.
Installing from ZIP looks like a good option, too, as it allows you to edit the agent properties before pushing it to the agent machines. And they can be bundled with JDK. You can then unzip it on the machine, and it's ready to go. Please refer to:
https://www.jetbrains.com/help/teamcity/install-teamcity-agent.html#Available+Agent+Distributions
https://www.jetbrains.com/help/teamcity/install-teamcity-agent.html#How+to+Install+Agents+from+ZIP+Files

And personally, my favorite way to automate agent installation in a similar scenario is to use build agent Docker images: https://www.jetbrains.com/help/teamcity/agent-docker-images.html

Best regards,
Anton
0

Please sign in to leave a comment.