【问题标题】:VSTS Build vNext Get Sources - Git.exe WarningVSTS Build vNext 获取源 - Git.exe 警告
【发布时间】:2016-06-01 14:26:20
【问题描述】:

我们在构建代理主机上安装了 git,但 VSTS 继续抱怨无法在 %PATH% 中找到 git.exe。有没有人发现这个问题?

构建日志

2016-06-01T14:15:23.5193018Z Syncing repository: MyRepo (Git)
2016-06-01T14:15:23.9412033Z Running 'git clean -fdx' on D:\BuildAgents_VSTS\A0\_work\22\s.
2016-06-01T14:15:23.9567937Z ##[warning]Git.exe is not installed or the path to Git.exe is not included in %PATH%.
2016-06-01T14:15:23.9567937Z ##[warning]Unable to run "git clean -fdx" and "git reset --hard HEAD" successfully, delete source folder instead.
2016-06-01T14:15:25.7068381Z Starting clone
2016-06-01T14:15:54.6447654Z Checking out dcf2e7a08159a102394f64e79c98e8921ccc4798 to D:\BuildAgents_VSTS\A0\_work\22\s
2016-06-01T14:16:57.8020148Z Checked out branch refs/heads/MyBranch for repository MyRepo at commit dcf2e7a08159a102394f64e79c98e8921ccc4798

最大的问题是因为这个问题,我们每次都克隆整个 repo。这减缓了我们 CI 策略的采用速度。

我们的路径中有 C:\Program Files\Git\cmd,其中包含 git.exe,但它没有被 VSTS 构建代理识别。

【问题讨论】:

    标签: git continuous-integration azure-devops azure-pipelines-build-task azure-pipelines


    【解决方案1】:

    VSTS Build vNext 不使用 System %PATH%,而是使用 User %PATH%。有 (2) 种修复它的方法 - 将路径分配给代理用户或编辑注册表以扩展用户路径。

    我们刚刚将C:\Program Files (x86)\Git\cmd 添加到HKEY_USERS\<Build Agent User SID>\Environment\Path

    【讨论】:

    • 还可以考虑在可能的情况下仅重新启动服务器,以便 系统 %PATH% 按预期自动应用于所有用户。
    猜你喜欢
    • 1970-01-01
    • 2018-07-24
    • 2018-02-03
    • 1970-01-01
    • 2016-09-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-21
    相关资源
    最近更新 更多