Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@MaxMelcher
Last active October 7, 2021 23:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save MaxMelcher/bfe95eb55b33fa7b9bdbf68c9ac51811 to your computer and use it in GitHub Desktop.
Save MaxMelcher/bfe95eb55b33fa7b9bdbf68c9ac51811 to your computer and use it in GitHub Desktop.
#!/bin/sh
echo $@
echo "start"
cd /home/azuredevopsuser
mkdir agent
cd agent
AGENTRELEASE="$(curl -s https://api.github.com/repos/Microsoft/azure-pipelines-agent/releases/latest | grep -oP '"tag_name": "v\K(.*)(?=")')"
AGENTURL="https://vstsagentpackage.azureedge.net/agent/${AGENTRELEASE}/vsts-agent-linux-x64-${AGENTRELEASE}.tar.gz"
echo "Release "${AGENTRELEASE}" appears to be latest"
echo "Downloading..."
wget -O agent.tar.gz ${AGENTURL}
tar zxvf agent.tar.gz
chmod -R 777 .
echo "extracted"
./bin/installdependencies.sh
echo "dependencies installed"
sudo -u azuredevopsuser ./config.sh --unattended --url $1 --auth pat --token $2 --pool $3 --agent $4 --acceptTeeEula --work ./_work --runAsService
echo "configuration done"
./svc.sh install
echo "service installed"
./svc.sh start
echo "service started"
echo "config done"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment