簡體   English   中英

如何在 Terragrunt 中引用私有 git 存儲庫的特定分支?

[英]How do I refer to a specific branch of a private git repo in Terragrunt?

我想將多分支私有git 存儲庫的feature/IaC (除主分支以外的任何特定分支)分支作為Terragrunt 配置文件的源參數

這是我的terragrunt.hcl文件中的一段代碼

terraform {
 source = "what_link_to_put_here?"
}

提前致謝。

正如官方文檔所說

默認情況下,Terraform 將克隆並使用所選存儲庫中的默認分支(由 HEAD 引用)。 您可以使用 ref 參數覆蓋它。 ref 參數的值可以是git 檢出命令可接受的任何引用,例如branch 、SHA-1 hash(短或完整)或標簽名稱。 Git 文檔包含完整列表。

所以:

source = "git::https://example.com/vpc.git?ref=xxx"  //xxx is a branch name.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM