【发布时间】:2020-11-03 11:25:35
【问题描述】:
我最近开始使用 terragrunt 并且一直想知道是否可以从特定分支而不是特定标签(或除了标签之外)而不是默认的 master 下载模块
从master下载特定标签:
terraform {
source = "git@github.com:<repo>/infrastructure-modules.git//gcp/bucket?ref=v.0.0.1"
}
从 repo 下载特定的分支?
# Pseudo code
terraform {
source = "git@github.com:<repo>/infrastructure-modules.git//gcp/bucket?ref=v.0.0.1%branch=test"
}
【问题讨论】:
-
ref=<mybranch>工作了吗? -
不,看起来标签在存储库范围内工作,所以我只是在分支上进行了更改,git add,git commit,git tag -a 'v1.branch',git push --follow-tags -你起源
,我可以标签引用分支不是 master -
好的,很高兴知道。我已经相应地编辑了答案,并包含了您的评论以获得更多可见性。
标签: git terraform terragrunt