-
Notifications
You must be signed in to change notification settings - Fork 3
Description
My org uses azure devops to handle CI this solution if it supported AZDO would be highly useful to keep our required number of macs on hand to a minimum.
The azure devops agent comes in 2 flavors:
- pipelines
- vsts-agent
vsts-agent contains legacy node for use with extensions requiring it, pipelines does not.
I've provided some starter scripts as part of issue, my org only cares about Arm64 so an enhancement to handle the x86_64 based macs via uname will be required should you use.
We parse the body off the latest release via the api, and extract out via pattern matching the proper version to download. We validate the sha256 checksum from the page after downloading the file. Parsing was originally done 100% in bash, but due to the differences in bash =~ operand in macos vs linux was changed to a powershell scriptlet.
Human Readable - https://github.com/microsoft/azure-pipelines-agent/releases
Machine - https://api.github.com/repos/microsoft/azure-pipelines-agent/releases
The script has AGENT_TYPE defined in it, the two valid values would be either pipelines-agent or vsts-agent
I have not included the script used to setup as a service as not sure that would be applicable here. I have not created a remove agent script from org yet either.
File: .env /.env.secret
AGENT_INSTALL_DIR=~/build-agent/
GITHUB_API_PAT=USER_PROVIDED
VSTS_AGENT_INPUT_TOKEN=USER_PROVIDEDdownload-agent.sh.txt
parse-releases.ps1.txt
configure-agent-clean.sh.txt
.capabilities.txt
The agent supports adding custom capabilities via a .capabilities file in ENV shell format if found in the install directory, it's not well documented but it is the approach that should be used for having the agent declare custom capabilities without user interaction on UI.
Reference links
https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/osx-agent?view=azure-devops&tabs=IP-V4