Skip to content

Commit 7564268

Browse files
feat: support RUNNER_TARBALL_URL in Windows install script
1 parent efbaa6f commit 7564268

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

modules/runners/templates/install-runner.ps1

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
## install the runner
22

3+
$s3_location = "${S3_LOCATION_RUNNER_DISTRIBUTION}"
4+
5+
if ([string]::IsNullOrEmpty($env:RUNNER_TARBALL_URL) -and [string]::IsNullOrEmpty($s3_location)) {
6+
Write-Error "Neither RUNNER_TARBALL_URL or s3_location are set"
7+
exit 1
8+
}
9+
310
Write-Host "Creating actions-runner directory for the GH Action installation"
411
New-Item -ItemType Directory -Path C:\actions-runner ; Set-Location C:\actions-runner
512

6-
Write-Host "Downloading the GH Action runner from s3 bucket $s3_location"
7-
aws s3 cp ${S3_LOCATION_RUNNER_DISTRIBUTION} actions-runner.zip
13+
if (-not [string]::IsNullOrEmpty($env:RUNNER_TARBALL_URL)) {
14+
Write-Host "Downloading the GH Action runner from $env:RUNNER_TARBALL_URL"
15+
Invoke-WebRequest -Uri $env:RUNNER_TARBALL_URL -OutFile actions-runner.zip -UseBasicParsing
16+
} else {
17+
Write-Host "Downloading the GH Action runner from s3 bucket $s3_location"
18+
aws s3 cp $s3_location actions-runner.zip
19+
}
820

921
Write-Host "Un-zip action runner"
1022
Expand-Archive -Path actions-runner.zip -DestinationPath .
1123

1224
Write-Host "Delete zip file"
1325
Remove-Item actions-runner.zip
14-

0 commit comments

Comments
 (0)