A Dockerized solution for Azure DevOps self hosted agent.
Welcome to Azure Local Agent repository.
The purpose of this repository is to provide a self hosted dockerized agent solution for our Azure DevOps pipelines to use for building and deploying our apps.
How to use this self hosted dockerized agent solution additional on pipelines defined in other project repositories:
- Open the Make file and go to the
run:
section.
... -e AZP_URL=https://dev.azure.com/cbsuk -e AZP_TOKEN=pusqt36t2saobskcdxrzxriw6kivqmup62fyuevteujmmqsolaeq -e AZP_AGENT_NAME=mydockeragent -e AZP_POOL=selfhosted dockeragent:latest --once
Adjust the bolded environment variables as needed, See below for details.
AZP_URL The URL of the Azure DevOps or Azure DevOps Server instance.
AZP_TOKEN Personal Access Token (PAT) with Agent Pools (read, manage) scope, created by a user who has permission to configure agents, at AZP_URL.
AZP_AGENT_NAME Agent name (default value: the container hostname).
AZP_POOL Agent pool name (default value: Default).
AZP_WORK Work directory (default value: _work).
https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops
- Clone the repository
- Run the command
make all
If the agent is not running this will be shown, so wait sometime for the dockerized agent to be up:
As you can see, the agent is now starting: 3. When the agent starts you'll see the below:
4.Confirm in the Azure DevOps platform that the self hosted agent is running:
-
Next, you'll need to tell your pipeline that you want to use your self hosted agent.
-
Add the name of pool where your self hosted agent is located:
-
Click the Save button on the top right to save the pipeline.
- Any changes to the main branch will trigger the pipeline to run. You don't need to keep the self hosted agent running... If the agent is not running the pipeline won't run. You can setup branch and pull request policies to control this.
Here is a side by side comparison (Docker: right, Azure DevOps: left) showing that the local agent was successful in running a pipeline:
Open an issue