Skip to content

Commit

Permalink
Support authentication in contrib/push-all.bzl
Browse files Browse the repository at this point in the history
  • Loading branch information
aherrmann authored and uhthomas committed Oct 6, 2022
1 parent 3cc173a commit e981b2a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contrib/push-all.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ def _impl(ctx):
pusher_args.append("--skip-unchanged-digest")
pusher_args.append("--dst={}".format(tag))
pusher_args.append("--format={}".format(ctx.attr.format))

# If the docker toolchain is configured to use a custom client config
# directory, use that instead
toolchain_info = ctx.toolchains["@io_bazel_rules_docker//toolchains/docker:toolchain_type"].info
if toolchain_info.client_config != "":
pusher_args += ["-client-config-dir", str(toolchain_info.client_config)]

out = ctx.actions.declare_file("%s.%d.push" % (ctx.label.name, index))
ctx.actions.expand_template(
template = ctx.file._tag_tpl,
Expand Down Expand Up @@ -129,6 +136,7 @@ container_push = rule(
),
},
executable = True,
toolchains = ["@io_bazel_rules_docker//toolchains/docker:toolchain_type"],
implementation = _impl,
)

Expand Down

0 comments on commit e981b2a

Please sign in to comment.