2018-11-29 14:35:17 +00:00
|
|
|
"""TODO: Add doc here"""
|
|
|
|
|
|
|
|
def _k8s_encrypted_secret_impl(ctx):
|
2019-12-18 20:52:26 +00:00
|
|
|
ctx.actions.run_shell(
|
|
|
|
inputs = [ctx.file.template],
|
|
|
|
outputs = [ctx.outputs.out],
|
|
|
|
progress_message = "Decrypting %s" % ctx.file.template,
|
|
|
|
tools = [ctx.executable._kubesec],
|
|
|
|
command = "%s decrypt %s > %s" % (ctx.executable._kubesec.path, ctx.file.template.path, ctx.outputs.out.path),
|
|
|
|
)
|
2018-11-29 14:35:17 +00:00
|
|
|
|
|
|
|
k8s_encrypted_secret = rule(
|
|
|
|
implementation = _k8s_encrypted_secret_impl,
|
|
|
|
attrs = {
|
2019-12-18 20:52:26 +00:00
|
|
|
"_kubesec": attr.label(
|
|
|
|
executable = True,
|
|
|
|
cfg = "host",
|
|
|
|
default = "//tools:kubesec",
|
|
|
|
),
|
|
|
|
"template": attr.label(
|
|
|
|
allow_single_file = True,
|
|
|
|
mandatory = True,
|
|
|
|
),
|
|
|
|
"out": attr.output(mandatory = True),
|
2018-11-29 14:35:17 +00:00
|
|
|
},
|
|
|
|
)
|