-
Notifications
You must be signed in to change notification settings - Fork 723
Expand file tree
/
Copy pathinstall-runner.ps1
More file actions
25 lines (19 loc) · 936 Bytes
/
install-runner.ps1
File metadata and controls
25 lines (19 loc) · 936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## install the runner
$s3_location = "${S3_LOCATION_RUNNER_DISTRIBUTION}"
if ([string]::IsNullOrEmpty($env:RUNNER_TARBALL_URL) -and [string]::IsNullOrEmpty($s3_location)) {
Write-Error "Neither RUNNER_TARBALL_URL or s3_location are set"
exit 1
}
Write-Host "Creating actions-runner directory for the GH Action installation"
New-Item -ItemType Directory -Path C:\actions-runner ; Set-Location C:\actions-runner
if (-not [string]::IsNullOrEmpty($env:RUNNER_TARBALL_URL)) {
Write-Host "Downloading the GH Action runner from $env:RUNNER_TARBALL_URL"
Invoke-WebRequest -Uri $env:RUNNER_TARBALL_URL -OutFile actions-runner.zip -UseBasicParsing
} else {
Write-Host "Downloading the GH Action runner from s3 bucket $s3_location"
aws s3 cp $s3_location actions-runner.zip
}
Write-Host "Un-zip action runner"
Expand-Archive -Path actions-runner.zip -DestinationPath .
Write-Host "Delete zip file"
Remove-Item actions-runner.zip