Skip to content

Commit 36a790f

Browse files
committed
Add support for print_progress to container_pull
Currently this depends on a forked version of puller.par. Pending pull request to upstream puller.par is here: google/containerregistry#66
1 parent 5d1b9c6 commit 36a790f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

container/container.bzl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ def repositories():
3939
if "puller" not in excludes:
4040
native.http_file(
4141
name = "puller",
42-
url = ("https://storage.googleapis.com/containerregistry-releases/" +
43-
CONTAINERREGISTRY_RELEASE + "/puller.par"),
44-
sha256 = "42309ba47bb28d1e1b81ef72789dcca396095e191d4f0e49e2e23c297edd27fb",
42+
url = "https://github.com/scele/containerregistry/releases/download/v0.0.26-print-progress/puller.par",
43+
sha256 = "2b4778a3f855729c126cc3c86d9ab44bbef28fda68f3344060c5bfcc78d0734e",
4544
executable = True,
4645
)
4746

container/pull.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ container_import(
7575
if "PULLER_TIMEOUT" in repository_ctx.os.environ:
7676
kwargs["timeout"] = int(repository_ctx.os.environ.get("PULLER_TIMEOUT"))
7777

78+
if repository_ctx.attr.print_progress:
79+
kwargs["quiet"] = False
80+
args += ["--print-progress"]
81+
7882
result = repository_ctx.execute(args, **kwargs)
7983
if result.return_code:
8084
fail("Pull command failed: %s (%s)" % (result.stderr, " ".join(args)))
@@ -85,6 +89,7 @@ container_pull = repository_rule(
8589
"repository": attr.string(mandatory = True),
8690
"digest": attr.string(),
8791
"tag": attr.string(default = "latest"),
92+
"print_progress": attr.bool(),
8893
"_puller": attr.label(
8994
executable = True,
9095
default = Label("@puller//file:puller.par"),

0 commit comments

Comments
 (0)