我一直试图在gitlab CI/CD上为一个演示项目启动我的渠道。我已经在我的windows本地机器上安装了gitlab-runner,并给出了"Shell“的执行类型。我已经成功地将gitlab-runner与我的gitlab项目集成在一起。但每当我将任何更改推送到repo时,管道都会启动,并以"pshw“not found in %PATH error结束。This is error which I'm getting every time
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
有没有人可以帮我解决这个问题,并解释我得到这个错误的原因。
提前感谢
发布于 2021-06-25 18:21:49
在选择外壳选项时,gitlab runner安装程序使用pwsh
作为执行器。它会生成一个config.toml
,如下所示
[[runners]]
name = "some name"
url = "http://someurl.com/"
token = "some-token"
executor = "shell"
shell = "pwsh"
问题是pwsh不是一个有效的windows命令(在我的安装中)。将pwsh
更改为powershell
并重启gitlab-runner
服务为我修复了这个问题。
发布于 2021-07-23 09:34:19
转到GitLab运行程序的安装目录,例如C:\Automation\GitLab-Runner。在这里你会看到config.toml文件,用记事本打开,并用powershell替换pwsh,如下所示:
发自:
[[runners]]
name = "PT-Runner"
url = "https://gitlab.com"
executor = "shell"
shell = **"pwsh"**
至:
[[runners]]
name = "PT-Runner"
url = "https://gitlab.com"
executor = "shell"
shell = **"powershell"**
https://stackoverflow.com/questions/68109273
复制相似问题