Azure Devops:从另一个存储库中克隆terraform模块

时间:2019-09-18 18:26:40

标签: azure-devops terraform

我们管道中的步骤之一是从另一个存储库下载用于Terraform的模块。

它开始间歇性地失败,但是在过去的5/6小时中一直可靠地失败。这是我们得到的输出。

Error: Failed to download module Could not download module "resource_group" (main.tf:1) source code from "git::https://company.visualstudio.com/Infrastructure/_git/TF-Modules": error downloading 'https://company.visualstudio.com/Infrastructure/_git/TF-Modules': E:\INFPRD01BLD02-A\externals\git\cmd\git.exe exited with 128: Cloning into '.terraform\modules\resource_group'... fatal: Authentication failed for 'https://ado:actual_systoken_here@company.visualstudio.com/Infrastructure/_git/TF-Modules/'

我们以前没有看到过,也不知道从哪里开始。 我已经检查了模块是否存在。系统令牌是在部署开始时在全局重写git url的步骤中声明的。将其添加到每个步骤都没有区别。

1 个答案:

答案 0 :(得分:0)

最后,我们发现管道中用于在全局配置中重写url的powershell步骤失败。我们有两种,一种是将url写入gitconfig文件,另一种是在运行结束时将其删除。

要删除的步骤失败了(我们需要删除它,因为它包含系统令牌),这意味着url在文件中多次。

这足以使登录步骤因上述错误而失败。