Ber*_*ler 6 gitlab gitlab-ci-runner
我想在我的 Windows 10 机器上安装一个gitlab-runner(executor shaell)。我在 gitlab 服务器上开始工作,它总是以消息结束the command "git" cannot be found(大致翻译成英文)。事实上,git这不是我的道路的一部分。如何PATH在gitlab-runner启动时修改shell 的变量?
To use git on the command line in windows I usually set it with the statement: PATH %PATH%C:\Program Files\Git\bin.
Is it documented somewhere, git has to be available to the runner?
How can I see the command line the runner invokes (i.e. the call to git)?
Dan*_*Dan 10
这个GitLab Runner 问题回答了您的问题。
该environment设置不起作用,因为它在设置变量之前进行评估,但您可以pre_build_script在运行程序配置中使用来更新路径。
[[runners]]
name = "My Runner"
url = "https://gitlab.com/"
token = "Abcd1234"
executor = "shell"
pre_build_script = "set Path=%GIT_HOME%\\usr\\bin;%Path%"
Run Code Online (Sandbox Code Playgroud)
出于测试目的,我开始了gitlab-runner类似的操作:gitlab-runner -l debug --debug run --config config.toml --service gitlab-runner从文件所在的目录gitlab-runner.exe开始config.toml。
我将以下行添加到runners我的文件的部分config.toml:
environment = ['PATH=%PATH%;d:/java/bin;C:/Program Files/Git/bin;c:/program files (x86)/apache-ant-1.10.1/bin']
| 归档时间: |
|
| 查看次数: |
9077 次 |
| 最近记录: |