Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timeout for attr for dockerfile_image. #2230

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion contrib/dockerfile_build.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _impl(repository_ctx):
if repository_ctx.attr.target:
command.extend(["--target", repository_ctx.attr.target])

build_result = repository_ctx.execute(command)
build_result = repository_ctx.execute(command, timeout = repository_ctx.attr.timeout)
if build_result.return_code:
fail("docker build command failed: {} ({})".format(
build_result.stderr,
Expand Down Expand Up @@ -126,6 +126,10 @@ dockerfile_image = repository_rule(
"target": attr.string(
doc = "Specify which intermediate stage to finish at, passed to `--target`.",
),
"timeout": attr.int(
doc = "Timeout for the build action (in seconds, default 600 seconds)",
default = 600,
),
},
implementation = _impl,
)