Added 'datasette publish now --force' option

This calls now with --force - which is useful as it means you get a fresh copy of
datasette even if now has already cached that docker layer.
This commit is contained in:
Simon Willison 2017-11-13 17:48:03 -08:00
commit fc7c04fe0b
2 changed files with 7 additions and 2 deletions

View file

@ -136,6 +136,7 @@ This will create a docker image containing both the datasette application and th
-n, --name TEXT Application name to use when deploying to Now
-m, --metadata FILENAME Path to JSON file containing metadata to publish
--extra-options TEXT Extra options to pass to datasette serve
--force Pass --force option to now
--help Show this message and exit.
## datasette package

View file

@ -37,7 +37,8 @@ def build(files, inspect_file):
help='Path to JSON file containing metadata to publish'
)
@click.option('--extra-options', help='Extra options to pass to datasette serve')
def publish(publisher, files, name, metadata, extra_options):
@click.option('--force', is_flag=True, help='Pass --force option to now')
def publish(publisher, files, name, metadata, extra_options, force):
"""
Publish specified SQLite database files to the internet along with a datasette API.
@ -58,7 +59,10 @@ def publish(publisher, files, name, metadata, extra_options):
sys.exit(1)
with temporary_docker_directory(files, name, metadata, extra_options):
call('now')
if force:
call(['now', '--force'])
else:
call('now')
@cli.command()