Skip to content

Commit e981b2a

Browse files
aherrmannuhthomas
authored andcommitted
Support authentication in contrib/push-all.bzl
1 parent 3cc173a commit e981b2a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

contrib/push-all.bzl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ def _impl(ctx):
5050
pusher_args.append("--skip-unchanged-digest")
5151
pusher_args.append("--dst={}".format(tag))
5252
pusher_args.append("--format={}".format(ctx.attr.format))
53+
54+
# If the docker toolchain is configured to use a custom client config
55+
# directory, use that instead
56+
toolchain_info = ctx.toolchains["@io_bazel_rules_docker//toolchains/docker:toolchain_type"].info
57+
if toolchain_info.client_config != "":
58+
pusher_args += ["-client-config-dir", str(toolchain_info.client_config)]
59+
5360
out = ctx.actions.declare_file("%s.%d.push" % (ctx.label.name, index))
5461
ctx.actions.expand_template(
5562
template = ctx.file._tag_tpl,
@@ -129,6 +136,7 @@ container_push = rule(
129136
),
130137
},
131138
executable = True,
139+
toolchains = ["@io_bazel_rules_docker//toolchains/docker:toolchain_type"],
132140
implementation = _impl,
133141
)
134142

0 commit comments

Comments
 (0)