gitlab-runner:准备环境无法在Windows中启动进程pwsh
在新的 WIN10 机器上安装带有 shell 执行器(即 powershell)的 gitlab-runner 并启动 CI 构建会引发以下错误:
Preparing environment
ERROR: Job failed (system failure): prepare environment: failed to start process: exec: "pwsh": executable file not found in %PATH%. Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information
回答
发现gitlab-runner config.toml中pwsh的shell属性条目在某些WIN10机器上不起作用。所以我不得不编辑 confg.toml 如下:
从
[[runners]]
name = "ci-runner"
url = "http://xxx.yyy.xx/"
token = "XXXXX"
executor = "shell"
shell = "pwsh"
到
[[runners]]
name = "ci-runner"
url = "http://xxx.yyy.xx/"
token = "XXXXX"
executor = "shell"
shell = "powershell"
然后重新启动 gitlab-runner 解决了这个问题。
gitlab-runner.exe restart
THE END
二维码