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", "-n",
"--name", "--name",
default="datasette", 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") @click.option("--spatialite", is_flag=True, help="Enable SpatialLite extension")
def cloudrun( def cloudrun(
@ -39,6 +44,7 @@ def publish_subcommand(publish):
about, about,
about_url, about_url,
name, name,
service,
spatialite, spatialite,
): ):
fail_if_publish_binary_not_installed( 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) 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 builds submit --tag {}".format(image_id), shell=True)
check_call( check_call(
"gcloud beta run deploy --allow-unauthenticated --image {}".format( "gcloud beta run deploy --allow-unauthenticated --image {}{}".format(
image_id image_id, " {}".format(service) if service else "",
), ),
shell=True, shell=True,
) )