yesod-mirror/tools/tanka.bzl
Copybara 8157b39ea4
Some checks failed
CI / build (push) Failing after 12s
Project import generated by Copybara.
GitOrigin-RevId: 6370f6ea785709295b6abcf9c60717cacf3ac432
2026-01-20 21:26:21 +00:00

62 lines
1.5 KiB
Python

load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
def tanka_environment(name, spec, main):
"""
Creates diff and apply targets for a Tanka environment.
Args:
name: Name of the environment (e.g., 'example')
spec: Label for the spec.json file
main: Label for the main.json file (generated by jsonnet_to_json)
"""
# Target to show manifests
sh_binary(
name = name + ".show",
srcs = ["//tools:tanka_runner.sh"],
args = [
"$(location //tools/tanka_shim)",
"$(location " + spec + ")",
"$(location " + main + ")",
"show",
],
data = [
"//tools/tanka_shim",
spec,
main,
],
)
# Target to diff manifests
sh_binary(
name = name + ".diff",
srcs = ["//tools:tanka_runner.sh"],
args = [
"$(location //tools/tanka_shim)",
"$(location " + spec + ")",
"$(location " + main + ")",
"diff",
],
data = [
"//tools/tanka_shim",
spec,
main,
],
)
# Target to apply manifests
sh_binary(
name = name + ".apply",
srcs = ["//tools:tanka_runner.sh"],
args = [
"$(location //tools/tanka_shim)",
"$(location " + spec + ")",
"$(location " + main + ")",
"apply",
],
data = [
"//tools/tanka_shim",
spec,
main,
],
)