下载紧凑型Git仓库
Schematics 工作空间充当 Terraform 模板的容器,其中包含输入数据,输出状态,作业和作业日志文件。 工作区使用 Terraform 模板的 Git URL。 例如,如果用户提供了下载并安全存储模板文件URL https://github.com/terraform-ibm-modules/terraform-ibm-database/tree/main/examples/simple-etcd
。 Schematics默认执行方式是下载Git并安全保存
Schematics 假定Terraform模板对存储库中其他文件夹中的模块、脚本或数据文件具有相对引用。
但是,有时,用户可能知道 Terraform 模板与特定文件夹及其 sub directory
(例如 Git 存储库中的 examples/simple-etcd
) 隔离。 现在,用户希望工作空间仅从 Git 存储库下载相关文件。 这可以通过使用 压缩下载 功能来实现。 压缩下载功能可缩短在创建或更新工作空间时从 Git 存储库下载和处理文件所需的时间。
使用压缩下载
您可以通过 console
取消选中 创建 Schematics 工作空间页面 上的 Download entire repo
复选框来激活 压缩下载 功能。 缺省情况下,选中此复选框以下载完整的 Git 存储库。
您还可以使用工作空间 create 中的 compact
字段或 update 有效内容 (如代码块中所示),通过 API or CLI
激活 压缩下载。
{
"name": "Testmyservice",
"type": [
"terraform_v1.4"
],
"description": "Create Terraform workspace to test compact feature",
"tags": [
"test:bbbranch"
],
"template_repo": {
"url": "https://github.com/IBM-Cloud/terraform-provider-ibm/tree/master/examples/ibm-resource-instance"
},
"template_data": [{
"folder": ".",
"compact": true,
"type": "terraform_v1.4"
}]
}