Aim: Run a local server as a build agent.
1. Add a user
Advised to run the agent under a specific user: sudo adduser azuredevops
Add user to sudoers: sudo adduser azuredevops sudo
2. Switch to new user
su azuredevops
3. Install the agent
Go to Azure DevOps, Organization settings, Agent Pools, Select Pool (Default), Add agent
- Make a dir: mkdir azureagent && cd azureagent
- Download: wget [Download URL]
- Unpack: tar zxvf vsts-agent-linux-x64-2.200.0.tar.gz
- Run: . config.sh
- Enter Server URL: https://dev.azure.com/{your-organization}
- Enter PAT: See Authenticate with PAT
4. Run the service
sudo ./svc.sh install azuredevops
sudo ./svc.sh start
5. Install dependencies
NB: You might need to install some dependencies depending on your build steps e.g. zip
6. Optional: Clear up Docker images
The agent downloads a load of Docker images which take up loads of space, so run a build on the server from Azure DevOps and then clean up the docker images: docker rmi -f $(docker images -aq)