最近一直在调试Azure DevOps Server中的Pipelines,因为对Git并不是很熟悉,因此在配置Pipelines的过程中吃了不少苦头。Azure DevOps Sever中的Pipelines是为了完成持续集成的工具,主要用于在开发过程中自动发布新版本的应用。在配置过程中一直遇到“Azure DevOps error ‘Git fetch failed with exit code 128‘ during build pipeline of other git Repository”的问题。虽然知道是因为我使用的是“自签证书”的原因,但是一直就没有找到解决方案。在网上也找了很久,也没有找到有效的解决方案。一度怀疑是不是只有我遇到了这个问题。后来还是在Microsoft的文档中找到了与之相关的解决方案:
方案如下:
Git get sources fails with SSL certificate problem (Windows agent only)
We ship command-line Git as part of the Windows agent. We use this copy of Git for all Git related operation. When you have a self-signed SSL certificate for your on-premises TFS server, make sure to configure the Git we shipped to allow that self-signed SSL certificate. There are 2 approaches to solve the problem.
-
Set the following git config in global level by the agent‘s run as user.
git config --global http."https://tfs.com/".sslCAInfo certificate.pem
- Enable git to use SChannel during configure with 2.129.0 or higher version agent Pass
--gituseschannel
during agent configuration./config.cmd --gituseschannel
解决这个问题后,就要面对MSBuild失败的问题了。感觉前路慢慢啊!!!