Sunday, February 9, 2020

Adding Self hosted agents

Requirements:
--------
Check the OS and runtime dependencies
https://github.com/microsoft/azure-pipelines-agent/tree/master/docs/start

identify a user with permissions to administer the agent pool.
Generate a personal access token (PAT)

https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/agents

Ensure the system can communicate outbound via HTTPS (TCP port 443)
Determine whether the agent will need to communicate via a proxy
Identify a local system account for the agent to use

https://docs.microsoft.com/en-us/azure/pipelines/agents/agents

on my machine local powershell:
get-cminstance Win32_ComputerSystem | Select-Object Caption
get-cminstance Win32_OperatingSystem | Select-Object Caption

check prereq details in microsoft/azure-pipelines-agent github repo.

$org = "orgname"
$uri = "https://dev.azure.com/$org"
Invoke-WebREquest -Uri $uri| Select-Object StatusCode #which will tell whether satisfed

For linux:
hostname
lsb_release -a | grep Description
org="orgname"
uri="https://dev.azure.com/${org}"
echo $uri
wget ${uri} 2>&1 | egrep "HTTP"

--------------
Onboarding agents
--
github>microsoft/azure-pipelines-agent

download the agent for the specific OS and install.
Extract the zip to a folder like c:\agent

azure devops portal > agent pools > add agent pool

now create personal access token.
user icon top -> security -> create a new token and download

run the config.cmd on agent.


get-service -name "vsts" --> Azure pipelines agent.


for linux you need to run installdependencies.sh from the zip file.
then config.sh








No comments:

Post a Comment