Buildkite Windows代理找不到git可执行文件

时间:2017-06-14 09:49:33

标签: windows powershell environment-variables command-prompt buildkite

我无法让Windows构建代理运行构建。代理无法签出我的源代码。 (我使用的是Windows 10)See GitHub issue

运行构建时出现以下错误:

Buildkite Error: There was an error running `git clone -v -- git@github.com:myorg/myrepo.git .` (exec: "git": executable file not found in %PATH%)

我使用git安装了chocolateygit可以在代理主机上的CMD和Powershell中访问,如果我运行{{},我可以在我的路径中看到它1}}在Powershell中。 gci env:Path的目录就在这里:

git

从BK网页用户界面中的构建日志中,我看到打印出以下环境变量:

C:\Program Files\Docker\Docker\Resources\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cm...

请注意,该输出中的BUILDKITE=true BUILDKITE_AGENT_ACCESS_TOKEN=xxx BUILDKITE_AGENT_DEBUG=true BUILDKITE_AGENT_ENDPOINT=https://agent.buildkite.com/v3 BUILDKITE_AGENT_ID=xxx BUILDKITE_AGENT_NAME=DESKTOP-1 BUILDKITE_AGENT_PID=5180 BUILDKITE_ARTIFACT_PATHS= BUILDKITE_BIN_PATH=C:\Users\Jason\Downloads\buildkite-agent-windows-amd64-3.0-beta.27 BUILDKITE_BRANCH=fix/build BUILDKITE_BUILD_CHECKOUT_PATH=builds\DESKTOP-1\myorg\myrepo BUILDKITE_BUILD_CREATOR=Jason BUILDKITE_BUILD_CREATOR_EMAIL=myemail@gmail.com BUILDKITE_BUILD_ID=xxx BUILDKITE_BUILD_NUMBER=18 BUILDKITE_BUILD_PATH=builds BUILDKITE_BUILD_URL=https://buildkite.com/myorg/myrepo/builds/18 BUILDKITE_COMMAND=msbuild BUILDKITE_COMMAND_EVAL=true BUILDKITE_COMMIT=HEAD BUILDKITE_GIT_CLEAN_FLAGS=-fxdq BUILDKITE_GIT_CLONE_FLAGS=-v BUILDKITE_HOOKS_PATH=hooks BUILDKITE_JOB_ID=xxx BUILDKITE_MESSAGE=First build BUILDKITE_ORGANIZATION_SLUG=myorg BUILDKITE_PIPELINE_DEFAULT_BRANCH=master BUILDKITE_PIPELINE_PROVIDER=github BUILDKITE_PIPELINE_SLUG=myrepo BUILDKITE_PLUGINS_PATH=plugins BUILDKITE_PROJECT_PROVIDER=github BUILDKITE_PROJECT_SLUG=myorg/myrepo BUILDKITE_PULL_REQUEST=false BUILDKITE_PULL_REQUEST_REPO= BUILDKITE_REPO=git@github.com:myorg/myrepo.git BUILDKITE_REPO_SSH_HOST=github.com BUILDKITE_RETRY_COUNT=0 BUILDKITE_SCRIPT_PATH=msbuild BUILDKITE_SOURCE=ui BUILDKITE_SSH_FINGERPRINT_VERIFICATION=true BUILDKITE_TAG= BUILDKITE_TIMEOUT=false CI=true PATH=C:\Users\Jason\Downloads\buildkite-agent-windows-amd64-3.0-beta.27; PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL 与Powershell中的PATH不同,并且不包含gits二进制文件的路径。

完整版输出:

PATH

1 个答案:

答案 0 :(得分:1)

您的构建输出似乎没有那些巧克力路径:

PATH=C:\Users\Jason\Downloads\buildkite-agent-windows-amd64-3.0-beta.27;

您可能需要添加agent environment hook,将正确的目录添加到路径中。或者尝试更新到可能解决问题的最新测试版。