Reputation: 8107
I run Azure DevOps agents in Docker as per guide on DockerHub:
docker run -d -e VSTS_ACCOUNT='kagarlickij' \
-e VSTS_POOL='Self-Hosted-Containers' \
-e VSTS_TOKEN='a***q' \
mcr.microsoft.com/azure-pipelines/vsts-agent:ubuntu-16.04-docker-18.06.1-ce
I'd like to automatically add custom capabilities to agent, how is it possible?
Upvotes: 6
Views: 1903
Reputation: 31053
When you create an agent, add the capability in the command. For example: docker run -d -e VSTS_ACCOUNT={account} -e VSTS_POOL={pool} -e VSTS_AGENT={agent} -e VSTS_TOKEN={token} -e myvar=test -it mcr.microsoft.com/azure-pipelines/vsts-agent:ubuntu-16.04-docker-18.06.1-ce
. I've tested on my side, I can see myvar
shows in the capabilities.
Upvotes: 8