Use writable macOS runner workdir
This commit is contained in:
parent
4e31d54a45
commit
6b9065008d
4 changed files with 38 additions and 7 deletions
|
|
@ -151,6 +151,14 @@ func readNSCBearerToken() (string, error) {
|
|||
return trimmed, nil
|
||||
}
|
||||
|
||||
func macosRunnerWorkDir(configured string) string {
|
||||
workdir := strings.TrimSpace(configured)
|
||||
if workdir == "" || strings.HasPrefix(workdir, "/var/lib/") {
|
||||
return "/tmp/forgejo-runner"
|
||||
}
|
||||
return workdir
|
||||
}
|
||||
|
||||
func parseMachineTypeCPUxMemGB(machineType string) (vcpu int32, memoryMB int32, err error) {
|
||||
parts := strings.Split(machineType, "x")
|
||||
if len(parts) != 2 {
|
||||
|
|
@ -183,10 +191,7 @@ func (d *Dispatcher) launchMacOSRunner(ctx context.Context, runnerName string, r
|
|||
httpClient := &http.Client{Timeout: 60 * time.Second}
|
||||
client := computev1betaconnect.NewComputeServiceClient(httpClient, d.opts.ComputeBaseURL)
|
||||
|
||||
workdir := d.opts.WorkDir
|
||||
if strings.TrimSpace(workdir) == "" {
|
||||
workdir = "/tmp/forgejo-runner"
|
||||
}
|
||||
workdir := macosRunnerWorkDir(d.opts.WorkDir)
|
||||
|
||||
env := map[string]string{
|
||||
"FORGEJO_INSTANCE_URL": req.InstanceURL,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue