Add Windows runner profiles and configuration for Gitea CI
- Introduced Dockerfiles for various Windows runner profiles: C/C++, .NET, Go, and MSYS. - Added a PowerShell script to start the Gitea runner with appropriate configurations. - Updated Ansible host variables to include new Windows build root and runner configurations. - Enhanced the Windows Gitea runner role to support multiple execution modes (linux_podman and windows_mcr). - Implemented tasks to validate runner execution modes, ensure necessary services are running, and manage Docker containers for Windows runners. - Created a new task file for managing Windows-specific runner operations. - Updated the configuration template to dynamically set paths for runner files and cache directories.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
$runner = "C:\gitea-runner\act_runner.exe"
|
||||
$config = if ($env:CONFIG_FILE) { $env:CONFIG_FILE } else { "C:\runner-data\config.yaml" }
|
||||
$runnerFile = if ($env:GITEA_RUNNER_FILE) { $env:GITEA_RUNNER_FILE } else { "C:\runner-data\.runner" }
|
||||
|
||||
if (-not (Test-Path -Path $runnerFile) -and $env:GITEA_INSTANCE_URL -and $env:GITEA_RUNNER_REGISTRATION_TOKEN) {
|
||||
$labels = if ($env:GITEA_RUNNER_LABELS) { $env:GITEA_RUNNER_LABELS } else { "windows:host" }
|
||||
$name = if ($env:GITEA_RUNNER_NAME) { $env:GITEA_RUNNER_NAME } else { $env:COMPUTERNAME }
|
||||
|
||||
& $runner register --no-interactive --instance $env:GITEA_INSTANCE_URL --token $env:GITEA_RUNNER_REGISTRATION_TOKEN --name $name --labels $labels --config $config
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
}
|
||||
|
||||
& $runner daemon --config $config
|
||||
exit $LASTEXITCODE
|
||||
Reference in New Issue
Block a user