Skip to content

Commit 3e59e04

Browse files
Merge pull request #17 from ayoussef-insight/fix/agent-name
Update agent host name
2 parents 06a928e + 662af90 commit 3e59e04

File tree

18 files changed

+41
-32
lines changed

18 files changed

+41
-32
lines changed

src/images/ado-agent-linux/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
NAME=ado-agent-linux
1+
NAME=
22
AZP_URL=https://dev.azure.com/ayoussef-insight/
33
AZP_TOKEN=
44
AZP_POOL=ado-agent-linux-pool

src/images/ado-agent-linux/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ choosing "Show all scopes".
2626
```bash
2727
docker-compose up --build -d --scale agent=2
2828
```
29+
For ARM64 architecture, use the following command:
30+
```bash
31+
docker-compose -f docker-compose-arm64.yml up --build -d --scale agent=2
32+
```
2933

3034
### Start from docker
3135

src/images/ado-agent-linux/docker-compose-arm64.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
context: .
77
args:
88
- ARCH=arm64
9-
- AGENT_VERSION=3.224.1
9+
- AGENT_VERSION=3.240.1
1010
env_file:
1111
- .env
1212
volumes:

src/images/ado-agent-linux/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
context: .
77
args:
88
- ARCH=amd64
9-
- AGENT_VERSION=3.224.1
9+
- AGENT_VERSION=3.240.1
1010
env_file:
1111
- .env
1212
volumes:

src/images/ado-agent-linux/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ trap 'cleanup; exit 143' TERM
5959
print_header "1. Configuring Azure Pipelines agent..."
6060

6161
./config.sh --unattended \
62-
--agent "${NAME:-$(hostname)}" \
62+
--agent "${NAME:-$HOSTNAME}" \
6363
--url "$AZP_URL" \
6464
--auth PAT \
6565
--token $(cat "$AZP_TOKEN_FILE") \

src/images/ado-agent-win/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
NAME=ado-agent-win
1+
NAME=
22
AZP_URL=https://dev.azure.com/ayoussef-insight/
33
AZP_TOKEN=
44
AZP_POOL=ado-agent-win-pool

src/images/ado-agent-win/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ RUN (New-Object Net.WebClient).DownloadFile('https://dot.net/v1/dotnet-install.p
5050
if (-not $currentPath.Contains($installPath)) { setx PATH ($currentPath + ';' + $installPath) } ; \
5151
if (-not $env:path.Contains($installPath)) { $env:path += ';' + $installPath }
5252

53-
# Install Node 18
54-
RUN (New-Object Net.WebClient).DownloadFile('https://nodejs.org/dist/v18.16.1/node-v18.16.1-x64.msi', '.\node.msi'); \
53+
# Install Node 20
54+
RUN (New-Object Net.WebClient).DownloadFile('https://nodejs.org/dist/v20.14.0/node-v20.14.0-x64.msi', '.\node.msi'); \
5555
Start-Process msiexec.exe -Wait -ArgumentList '/I node.msi /quiet'; \
5656
Remove-Item .\node.msi;
5757

src/images/ado-agent-win/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
build:
66
context: .
77
args:
8-
- AGENT_VERSION=3.224.1
8+
- AGENT_VERSION=3.240.1
99
env_file:
1010
- .env
1111
environment:

src/images/ado-agent-win/start.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ try
2727
Write-Host "1. Configuring Azure Pipelines agent..." -ForegroundColor Cyan
2828

2929
.\config.cmd --unattended `
30-
--agent "$(if (Test-Path Env:NAME) { ${Env:NAME} } else { hostname })" `
30+
--agent "$(if (Test-Path Env:NAME) { ${Env:NAME} } else { ${Env:COMPUTERNAME} })" `
3131
--url "$(${Env:AZP_URL})" `
3232
--auth PAT `
3333
--token "$(Get-Content ${Env:AZP_TOKEN_FILE})" `

src/images/github-runner-linux/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
NAME=hosted-runner-01
1+
NAME=
22
GITHUB_TOKEN=
33
GITHUB_REPOSITORY=ayoussef-insight/self-hosted-agents

src/images/github-runner-linux/docker-compose-arm64.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
context: .
77
args:
88
- ARCH=arm64
9-
- RUNNER_VERSION=2.308.0
9+
- RUNNER_VERSION=2.317.0
1010
env_file:
1111
- .env
1212
volumes:

src/images/github-runner-linux/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
context: .
77
args:
88
- ARCH=amd64
9-
- RUNNER_VERSION=2.308.0
9+
- RUNNER_VERSION=2.317.0
1010
env_file:
1111
- .env
1212
volumes:

src/images/github-runner-linux/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ print_header "2. Configuring github actions runner..."
3636

3737
./config.sh \
3838
--unattended \
39-
--name $NAME \
39+
--name "${NAME:-$HOSTNAME}" \
4040
--replace \
4141
--url https://github.com/$GITHUB_REPOSITORY \
4242
--token $TOKEN

src/images/github-runner-win/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
NAME=hosted-runner-01
1+
NAME=
22
GITHUB_TOKEN=
33
GITHUB_REPOSITORY=ayoussef-insight/self-hosted-agents

src/images/github-runner-win/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ RUN (New-Object Net.WebClient).DownloadFile('https://dot.net/v1/dotnet-install.p
5050
if (-not $currentPath.Contains($installPath)) { setx PATH ($currentPath + ';' + $installPath) } ; \
5151
if (-not $env:path.Contains($installPath)) { $env:path += ';' + $installPath }
5252

53-
# Install Node 18
54-
RUN (New-Object Net.WebClient).DownloadFile('https://nodejs.org/dist/v18.16.1/node-v18.16.1-x64.msi', '.\node.msi'); \
53+
# Install Node 20
54+
RUN (New-Object Net.WebClient).DownloadFile('https://nodejs.org/dist/v20.14.0/node-v20.14.0-x64.msi', '.\node.msi'); \
5555
Start-Process msiexec.exe -Wait -ArgumentList '/I node.msi /quiet'; \
5656
Remove-Item .\node.msi;
5757

src/images/github-runner-win/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
build:
66
context: .
77
args:
8-
- RUNNER_VERSION=2.308.0
8+
- RUNNER_VERSION=2.317.0
99
env_file:
1010
- .env
1111
environment:

src/images/github-runner-win/start.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Remove-Item Env:GITHUB_TOKEN
1717

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

2221
try
2322
{
@@ -28,7 +27,7 @@ try
2827
Write-Host "2. Configuring github actions runner..." -ForegroundColor Cyan
2928

3029
.\config.cmd --unattended `
31-
--name "$Name" `
30+
--name "$(if (Test-Path Env:NAME) { ${Env:NAME} } else { ${Env:COMPUTERNAME} })" `
3231
--url "https://github.com/$GITHUB_REPOSITORY" `
3332
--token "$Token" `
3433
--replace

src/infrastructure/acr/main.bicep

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,25 @@ resource acrResource 'Microsoft.ContainerRegistry/registries@2021-06-01-preview'
1616
}
1717
properties: {
1818
adminUserEnabled: true
19-
policies: acrSku == 'Premium' ? {
20-
quarantinePolicy: {
21-
status: 'enabled'
22-
}
23-
trustPolicy: {
24-
status: 'enabled'
25-
type: 'Notary'
26-
}
27-
retentionPolicy: {
28-
status: 'enabled'
29-
days: 30
30-
}
31-
} : {}
19+
publicNetworkAccess: acrSku == 'Premium' ? 'Disabled' : 'Enabled'
20+
networkRuleSet: acrSku == 'Premium' ? {
21+
defaultAction: 'Deny'
22+
} : null
23+
policies: acrSku == 'Premium'
24+
? {
25+
quarantinePolicy: {
26+
status: 'enabled'
27+
}
28+
trustPolicy: {
29+
status: 'enabled'
30+
type: 'Notary'
31+
}
32+
retentionPolicy: {
33+
status: 'enabled'
34+
days: 30
35+
}
36+
}
37+
: {}
3238
}
3339
}
3440

0 commit comments

Comments
 (0)