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, ], )