我无法让 Windows 构建代理运行构建。代理无法签出我的源代码。(我使用的是 Windows 10)查看 GitHub 问题
我在运行构建时看到以下错误:
Buildkite Error: There was an error running `git clone -v -- git@github.com:myorg/myrepo.git .` (exec: "git": executable file not found in %PATH%)
我已经使用代理主机上的 CMD 和 Powershell 进行了安装git
,并且可以在其中访问它,如果我在 Powershell 中运行,我可以在我的路径中看到chocolatey
它。的目录在最后:git
gci env:Path
git
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...
从 BK 的 Web UI 中的构建日志中,我看到打印出以下环境变量:
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
请注意,PATH
该输出与 Powershell 中的我的输出不同,PATH
并且不包含 gits 二进制文件的路径。
完整的构建输出:
Build environment variables 0s
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
Running global environment hook 0s
# Skipping, no hook script found at "hooks\environment.bat"
Running global pre-checkout hook 0s
# Skipping, no hook script found at "hooks\pre-checkout.bat"
Preparing build directory 0s
# Changing working directory to "builds\DESKTOP-1\myorg\myrepo"
⚠ Buildkite Warning: Could not performn `ssh-keygen` (exec: "ssh-keygen": executable file not found in %PATH%)
> git clone -v -- git@github.com:myorg/myrepo.git .
Buildkite Error: There was an error running `git clone -v -- git@github.com:myorg/myrepo.git .` (exec: "git": executable file not found in %PATH%)