devbuild: only build terraform provider if enterprise flag is set

This commit is contained in:
Malte Poll 2023-12-21 15:26:40 +01:00
parent 8644b958ea
commit 8eb3515341

View file

@ -10,12 +10,17 @@ sh_template(
"//bootstrapper/cmd/bootstrapper:bootstrapper_patched", "//bootstrapper/cmd/bootstrapper:bootstrapper_patched",
"//cli:cli_edition_host", "//cli:cli_edition_host",
"//debugd/cmd/cdbg:cdbg_host", "//debugd/cmd/cdbg:cdbg_host",
"//terraform-provider-constellation:terraform_rc",
"//terraform-provider-constellation:tf_provider",
"//upgrade-agent/cmd:upgrade_agent_linux_amd64", "//upgrade-agent/cmd:upgrade_agent_linux_amd64",
"@gnused//:bin/sed", "@gnused//:bin/sed",
"@yq_toolchains//:resolved_toolchain", "@yq_toolchains//:resolved_toolchain",
] + select(
{
"//bazel/settings:cli_edition_enterprise": [
"//terraform-provider-constellation:terraform_rc",
"//terraform-provider-constellation:tf_provider",
], ],
},
),
substitutions = { substitutions = {
"@@BOOTSTRAPPER@@": "$(rootpath //bootstrapper/cmd/bootstrapper:bootstrapper_patched)", "@@BOOTSTRAPPER@@": "$(rootpath //bootstrapper/cmd/bootstrapper:bootstrapper_patched)",
"@@CDBG@@": "$(rootpath //debugd/cmd/cdbg:cdbg_host)", "@@CDBG@@": "$(rootpath //debugd/cmd/cdbg:cdbg_host)",
@ -23,8 +28,6 @@ sh_template(
"@@CONTAINER_SUMS@@": "$(rootpath //bazel/release:container_sums)", "@@CONTAINER_SUMS@@": "$(rootpath //bazel/release:container_sums)",
"@@EDITION@@": "$(rootpath :devbuild_cli_edition)", "@@EDITION@@": "$(rootpath :devbuild_cli_edition)",
"@@SED@@": "$(rootpath @gnused//:bin/sed)", "@@SED@@": "$(rootpath @gnused//:bin/sed)",
"@@TERRAFORM_PROVIDER@@": "$(rootpath //terraform-provider-constellation:tf_provider)",
"@@TERRAFORM_RC@@": "$(rootpath //terraform-provider-constellation:terraform_rc)",
"@@UPGRADE_AGENT@@": "$(rootpath //upgrade-agent/cmd:upgrade_agent_linux_amd64)", "@@UPGRADE_AGENT@@": "$(rootpath //upgrade-agent/cmd:upgrade_agent_linux_amd64)",
"@@VERSION_FILE@@": "$(rootpath //bazel/settings:tag)", "@@VERSION_FILE@@": "$(rootpath //bazel/settings:tag)",
"@@YQ@@": "$(rootpath @yq_toolchains//:resolved_toolchain)", "@@YQ@@": "$(rootpath @yq_toolchains//:resolved_toolchain)",
@ -42,7 +45,14 @@ sh_template(
"@platforms//cpu:x86_64": { "@platforms//cpu:x86_64": {
"@@GOARCH@@": "amd64", "@@GOARCH@@": "amd64",
}, },
}), }) | select(
{
"//bazel/settings:cli_edition_enterprise": {
"@@TERRAFORM_PROVIDER@@": "$(rootpath //terraform-provider-constellation:tf_provider)",
"@@TERRAFORM_RC@@": "$(rootpath //terraform-provider-constellation:terraform_rc)",
},
},
),
template = "prepare_developer_workspace.sh.in", template = "prepare_developer_workspace.sh.in",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )