Some checks failed
CI / build (push) Failing after 12s
GitOrigin-RevId: 6370f6ea785709295b6abcf9c60717cacf3ac432
62 lines
1.5 KiB
Python
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,
|
|
],
|
|
)
|