Skip to content

Commit

Permalink
Add hostname suffix to agent name
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoussef-insight committed Jun 17, 2024
1 parent dcf5daf commit 40fa2b6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/images/ado-agent-linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ choosing "Show all scopes".
```bash
docker-compose up --build -d --scale agent=2
```
For ARM64 architecture, use the following command:
```bash
docker-compose -f docker-compose-arm64.yml up --build -d --scale agent=2
```

### Start from docker

Expand Down
2 changes: 1 addition & 1 deletion src/images/ado-agent-linux/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ trap 'cleanup; exit 143' TERM
print_header "1. Configuring Azure Pipelines agent..."

./config.sh --unattended \
--agent "${NAME:-$(hostname)}" \
--agent "${NAME:-agent}-${HOSTNAME}" \
--url "$AZP_URL" \
--auth PAT \
--token $(cat "$AZP_TOKEN_FILE") \
Expand Down
2 changes: 1 addition & 1 deletion src/images/ado-agent-win/start.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ try
Write-Host "1. Configuring Azure Pipelines agent..." -ForegroundColor Cyan

.\config.cmd --unattended `
--agent "$(if (Test-Path Env:NAME) { ${Env:NAME} } else { hostname })" `
--agent "$(if (Test-Path Env:NAME) { "${Env:NAME}-${Env:HOSTNAME}" } else { "runner-${Env:HOSTNAME}" })" `
--url "$(${Env:AZP_URL})" `
--auth PAT `
--token "$(Get-Content ${Env:AZP_TOKEN_FILE})" `
Expand Down
2 changes: 1 addition & 1 deletion src/images/github-runner-linux/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ print_header "2. Configuring github actions runner..."

./config.sh \
--unattended \
--name $NAME \
--name "${NAME:-agent}-${HOSTNAME}" \
--replace \
--url https://github.com/$GITHUB_REPOSITORY \
--token $TOKEN
Expand Down
3 changes: 1 addition & 2 deletions src/images/github-runner-win/start.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Remove-Item Env:GITHUB_TOKEN

$GITHUB_REPOSITORY=$Env:GITHUB_REPOSITORY
$GITHUB_TOKEN=$(Get-Content $Env:GITHUB_TOKEN_FILE)
$Name = if ($env:NAME) { $env:NAME } else { "hosted-runner-01" }

try
{
Expand All @@ -28,7 +27,7 @@ try
Write-Host "2. Configuring github actions runner..." -ForegroundColor Cyan

.\config.cmd --unattended `
--name "$Name" `
--name "$(if (Test-Path Env:NAME) { "${Env:NAME}-${Env:HOSTNAME}" } else { "runner-${Env:HOSTNAME}" })" `
--url "https://github.com/$GITHUB_REPOSITORY" `
--token "$Token" `
--replace
Expand Down

0 comments on commit 40fa2b6

Please sign in to comment.