datasette publish cloudrun --service=x, closes #457

pull/458/head
Simon Willison 2019-05-09 09:45:01 -07:00
rodzic 2db977d8f3
commit b80b03ac9a
1 zmienionych plików z 9 dodań i 3 usunięć

Wyświetl plik

@ -18,7 +18,12 @@ def publish_subcommand(publish):
"-n",
"--name",
default="datasette",
help="Application name to use when deploying",
help="Application name to use when building",
)
@click.option(
"--service",
default="",
help="Cloud Run service to deploy (or over-write)",
)
@click.option("--spatialite", is_flag=True, help="Enable SpatialLite extension")
def cloudrun(
@ -39,6 +44,7 @@ def publish_subcommand(publish):
about,
about_url,
name,
service,
spatialite,
):
fail_if_publish_binary_not_installed(
@ -73,8 +79,8 @@ def publish_subcommand(publish):
image_id = "gcr.io/{project}/{name}".format(project=project, name=name)
check_call("gcloud builds submit --tag {}".format(image_id), shell=True)
check_call(
"gcloud beta run deploy --allow-unauthenticated --image {}".format(
image_id
"gcloud beta run deploy --allow-unauthenticated --image {}{}".format(
image_id, " {}".format(service) if service else "",
),
shell=True,
)