Last active
February 11, 2025 20:12
-
-
Save jakebrinkmann/ae14c47ee7fd77ec03f5f78879dedda9 to your computer and use it in GitHub Desktop.
Setup Azure DevOps agent (self-hosted) on Linux Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
INSTALL_PATH=~/.devops-agent | |
mkdir -p $INSTALL_PATH | |
URL='https://vstsagentpackage.azureedge.net/agent/4.251.0/vsts-agent-linux-x64-4.251.0.tar.gz' | |
curl -O $URL | |
FILENAME=$(readlink -f $(basename $URL)) | |
tar zxvf $FILENAME -C $INSTALL_PATH | |
# NOTE: Need to make a Personal Access Token (PAT) with Agent Pool (read, manage) permissions | |
cd $INSTALL_PATH | |
./config.sh \ | |
--unattended \ | |
--agent inhouse-linux-$USER-agent \ | |
--pool "In-House Deployments" \ | |
--url https://dev.azure.com/$AZ_ORGANIZATION_NAME \ | |
--auth PAT \ | |
--token $AZ_DEVOPS_PAT | |
# Start the agent (interactive) | |
./run.sh | |
# Start the agent (as a service) | |
# needs devops-agent user | |
sudo ./svc.sh install devops-agent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment