Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Add timeout for attr for dockerfile_image. #2230

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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,
)