mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Add timeout option to Cloudrun build (#1717)
* Add timeout option for build phase * Make the --timeout setting optional * Add test for --timeout setting Thanks, @wragge
This commit is contained in:
parent
d57c347f35
commit
3001e1e394
2 changed files with 30 additions and 13 deletions
|
|
@ -41,6 +41,10 @@ def publish_subcommand(publish):
|
|||
type=click.Choice(["1", "2", "4"]),
|
||||
help="Number of vCPUs to allocate in Cloud Run",
|
||||
)
|
||||
@click.option(
|
||||
"--timeout",
|
||||
help="Build timeout in seconds",
|
||||
)
|
||||
@click.option(
|
||||
"--apt-get-install",
|
||||
"apt_get_extras",
|
||||
|
|
@ -72,6 +76,7 @@ def publish_subcommand(publish):
|
|||
show_files,
|
||||
memory,
|
||||
cpu,
|
||||
timeout,
|
||||
apt_get_extras,
|
||||
):
|
||||
"Publish databases to Datasette running on Cloud Run"
|
||||
|
|
@ -156,7 +161,12 @@ def publish_subcommand(publish):
|
|||
print("\n====================\n")
|
||||
|
||||
image_id = f"gcr.io/{project}/{name}"
|
||||
check_call(f"gcloud builds submit --tag {image_id}", shell=True)
|
||||
check_call(
|
||||
"gcloud builds submit --tag {}{}".format(
|
||||
image_id, " --timeout {}".format(timeout) if timeout else ""
|
||||
),
|
||||
shell=True,
|
||||
)
|
||||
check_call(
|
||||
"gcloud run deploy --allow-unauthenticated --platform=managed --image {} {}{}{}".format(
|
||||
image_id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue