【问题标题】:Sourcing a tagged terraform module in Azure DevOps Git Repo在 Azure DevOps Git Repo 中采购标记的 terraform 模块
【发布时间】:2018-12-19 16:40:53
【问题描述】:

尝试从 Azure DevOps 中的 git 存储库获取 terraform 模块。

这可行,并从主分支中提取代码

模块“我的模块”{

      source ="git::https://dev.azure.com/company/project/_git/MyModules//module1"

    }

这不起作用,而是将我重定向到网页。

    module "my_module" {

      source ="git::https://dev.azure.com/company/project/_git/MyModules//module1?ref=GT1.0"

    }

【问题讨论】:

    标签: azure-devops terraform


    【解决方案1】:

    我将公共 repo https://github.com/terraform-aws-modules/terraform-aws-ecs.git 导入 Azure DevOps Git

    module "ecs" {
      source = "git::https://dev.azure.com/xxxxxxxx/terraform-aws-ecs/_git/terraform-aws-ecs?ref=v1.0.0"
    
      name = "my-ecs"
    }
    

    我可以毫无问题地拿到包裹

    $ terraform get
    - module.ecs
      Getting source "git::https://dev.azure.com/xxxxxxxx/terraform-aws-ecs/_git/terraform-aws-ecs?ref=v1.0.0"
    

    【讨论】:

    • 奇怪。我正在做完全相同的事情,但不起作用Error loading modules: error downloading 'https://dev.azure.com/company/project/_git/MyModules?ref=v1.0': C:\Program Files\Git\mingw64\bin\git.exe exited with 1: error: pathspec 'v1.0' did not match any file(s) known to git
    • 是否有名为v1.0 或只是1.0 的版本或标签?使用命令git tag 显示所有标签并确保v1.0 在输出中
    猜你喜欢
    • 2020-08-10
    • 1970-01-01
    • 2022-10-21
    • 2020-03-29
    • 2020-02-15
    • 2021-06-25
    • 1970-01-01
    • 2019-10-27
    • 1970-01-01
    相关资源
    最近更新 更多