【问题标题】:Azure release pipeline not able to see Terraform configuration file from git repoAzure 发布管道无法从 git repo 中看到 Terraform 配置文件
【发布时间】:2020-06-17 15:04:50
【问题描述】:

创建了一个简单的 Azure devops 发布管道来预配资源组。在本地使用远程状态文件测试 terraform 脚本并将代码签入到 git。这是代码的组织方式: IAC(根文件夹) /bin/terraform.exe main.tf(这具有远程状态的 terraform 配置)

创建了一个发布管道,以代码形式指向此存储库。管道为工件提供别名 _IAC

在管道中,我有使用服务主体登录到 azure 的 powershell 活动

然后是以下行:

$(System.DefaultWorkingDirectory)/_IAC/bin/terraform init

这个命令执行了,但是说没有 terraform 配置文件。

2020-03-05T02:23:04.4536130Z [0m[1mTerraform initialized in an empty directory![0m
2020-03-05T02:23:04.4536786Z 
2020-03-05T02:23:04.4556953Z The directory has no Terraform configuration files. You may begin working
2020-03-05T02:23:04.4559693Z with Terraform immediately by creating Terraform configuration files.[0m

【问题讨论】:

    标签: terraform azure-pipelines-release-pipeline


    【解决方案1】:

    运行 Azure 发布管道代理的工作目录没有配置文件。 我不得不使用复制操作将 main.tf 文件复制到 $(AgentWorkingDirectory)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-05-20
      • 2023-02-10
      • 2020-07-11
      • 1970-01-01
      • 2019-09-19
      • 1970-01-01
      • 2020-03-29
      • 1970-01-01
      相关资源
      最近更新 更多