"""Defines high-level macros for fetch_digest""" def fetch_digests(tag, registry, repo, images, name = "fetch-digests"): """Macro for using `fetch_digest` from a list of images it will produce a file to source list of container digests from""" native.genrule( name = name, srcs = [], outs = [name + "_digest"], cmd = "echo $(location //hack/tools/fetch-digests:fetch-digests.sh) {0} {1} {2} {3} $(location @com_github_google_go_containerregistry//cmd/crane) > $@".format(tag, registry, repo, ",".join(images)), executable = True, tools = [ "//hack/tools/fetch-digests:fetch-digests.sh", "@com_github_google_go_containerregistry//cmd/crane", ], )