contentTags | ||||
---|---|---|---|---|
|
This page describes how to manually install CircleCI’s machine runner 3 on Windows Server.
-
The CircleCI CLI if you wish to install runners from the command line
Using PowerShell, download the current version of CircleCI machine runner and verify the download.
Note
|
The current CircleCI machine runner binary can always be found by using current as the version. To install a specific previous version of the CircleCI runner the $runnerVersion variable can be changed from the value of current to the specific preferred version.
|
$runnerVersion = "current"
$availableAgents = (Invoke-WebRequest "https://circleci-binary-releases.s3.amazonaws.com/circleci-runner/manifest.json" -UseBasicParsing).Content.Trim() | ConvertFrom-Json
$agentURL = $availableAgents.releases.$runnerVersion.windows.amd64.url
$agentHash = $availableAgents.releases.$runnerVersion.windows.amd64.sha256
$agentFile = $agentURL.Split("/")[-1]
Invoke-WebRequest $agentURL -OutFile $agentFile -UseBasicParsing
if ((Get-FileHash "$agentFile" -Algorithm SHA256).Hash.ToLower() -ne $agentHash.ToLower()) {
throw "Invalid checksum for CircleCI Machine Runner, please try download again"
}
tar -zxvf $agentFile
del $agentFile
Using PowerShell, create the CircleCI machine runner configuration file and working directory.
Note
|
The runner token created in Step 1 will need to be substituted in for the auth_token
|
New-Item -Name Workdir -ItemType Directory
@"
api:
auth_token: "<< YOUR RUNNER TOKEN >>"
url: https://runner.circleci.com
runner:
name: "$env:COMPUTERNAME"
mode: single-task
working_directory: "./Workdir"
cleanup_working_directory: true
logging:
file: circleci-runner.log
"@ -replace "([^`r])`n", "`$1`r`n" | Out-File machine-runner-config.yaml -Encoding ascii
./circleci-runner.exe machine --config machine-runner-config.yaml