mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
parent
80bf3afa43
commit
0539905806
3 changed files with 6 additions and 6 deletions
|
|
@ -26,7 +26,7 @@ def cli():
|
|||
'sqlite_extensions', '--load-extension', envvar='SQLITE_EXTENSIONS', multiple=True,
|
||||
type=click.Path(exists=True, resolve_path=True), help='Path to a SQLite extension to load'
|
||||
)
|
||||
def build(files, inspect_file, sqlite_extensions):
|
||||
def inspect(files, inspect_file, sqlite_extensions):
|
||||
app = Datasette(files, sqlite_extensions=sqlite_extensions)
|
||||
open(inspect_file, 'w').write(json.dumps(app.inspect(), indent=2))
|
||||
|
||||
|
|
@ -225,7 +225,7 @@ class StaticMount(click.ParamType):
|
|||
'sqlite_extensions', '--load-extension', envvar='SQLITE_EXTENSIONS', multiple=True,
|
||||
type=click.Path(exists=True, resolve_path=True), help='Path to a SQLite extension to load'
|
||||
)
|
||||
@click.option('--inspect-file', help='Path to JSON file created using "datasette build"')
|
||||
@click.option('--inspect-file', help='Path to JSON file created using "datasette inspect"')
|
||||
@click.option('-m', '--metadata', type=click.File(mode='r'), help='Path to JSON file containing license/source metadata')
|
||||
@click.option('-t', '--template-dir', type=click.Path(exists=True, file_okay=False, dir_okay=True), help='Path to directory containing custom templates')
|
||||
@click.option('-s', '--static', type=StaticMount(), help='mountpoint:path-to-directory for serving static files', multiple=True)
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ FROM python:3
|
|||
COPY . /app
|
||||
WORKDIR /app
|
||||
RUN pip install {install_from}
|
||||
RUN datasette build {files} --inspect-file inspect-data.json
|
||||
RUN datasette inspect {files} --inspect-file inspect-data.json
|
||||
EXPOSE 8001
|
||||
CMD [{cmd}]'''.format(
|
||||
files=' '.join(files),
|
||||
|
|
@ -232,7 +232,7 @@ def temporary_heroku_directory(files, name, metadata, extra_options, branch=None
|
|||
|
||||
open('requirements.txt', 'w').write(install_from)
|
||||
os.mkdir('bin')
|
||||
open('bin/post_compile', 'w').write('datasette build --inspect-file inspect-data.json')
|
||||
open('bin/post_compile', 'w').write('datasette inspect --inspect-file inspect-data.json')
|
||||
|
||||
quoted_files = " ".join(map(shlex.quote, files))
|
||||
procfile_cmd = 'web: datasette serve --host 0.0.0.0 {quoted_files} --cors --port $PORT --inspect-file inspect-data.json'.format(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue