Skip to content

Commit

Permalink
chore: Add powershell scripts for circleCI Runner
Browse files Browse the repository at this point in the history
  • Loading branch information
HaiyiMei committed Aug 5, 2024
1 parent 7cd9bb6 commit 9ad1c23
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .circleci/Start-CircleCIRunner.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
$installDirPath = "$env:ProgramFiles\CircleCI"
$agentFile = "circleci-runner.exe"
$cmd = "`"$installDirPath\$agentFile`" machine --config `"$installDirPath\runner-agent-config.yaml`""
$agentPath = Join-Path -Path $installDirPath -ChildPath "circleci-runner.exe"
$configPath = Join-Path -Path $installDirPath -ChildPath "runner-agent-config.yaml"

echo "Constantly running command: $cmd"
echo "Constantly running CircleCI Runner Agent"
while ($true) {
Invoke-Expression $cmd
echo "--- Restarting CircleCI Runner Agent ---"
try {
& $agentPath machine --config $configPath
} catch {
echo "Error: $_"
}
Start-Sleep 1
}

0 comments on commit 9ad1c23

Please sign in to comment.