1. 程式人生 > 其它 >Azure DevOps Server Pipelines需要注意的幾個問題

Azure DevOps Server Pipelines需要注意的幾個問題

最近一直在除錯AzureDevOpsServer中的Pipelines,因為對Git並不是很熟悉,因此在配置Pipelines的過程中吃了不少苦頭。AzureDevOpsSever中的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.

  1. 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
  2. Enable git to use SChannel during configure with 2.129.0 or higher version agent Pass--gituseschannelduring agent configuration
    ./config.cmd --gituseschannel

    解決這個問題後,就要面對MSBuild失敗的問題了。感覺前路慢慢啊!!!