Reworked metadata building options

Building metadata is now optional. If you want to do it, do this:

    datasette build *.db --metadata=metadata.json

Then when you run the server you can tell it to read from metadata:

    datasette serve *.db --metadata=metadata.json

The Dockerfile generated by datasette publish now uses this mechanism.

Closes #60
This commit is contained in:
Simon Willison 2017-11-11 12:10:51 -08:00
commit 40a563ebac
4 changed files with 98 additions and 89 deletions

View file

@ -122,10 +122,10 @@ def make_dockerfile(files):
FROM python:3
COPY . /app
WORKDIR /app
RUN pip install https://static.simonwillison.net/static/2017/datasette-0.1-py3-none-any.whl
RUN datasette build {}
RUN pip install https://static.simonwillison.net/static/2017/datasette-0.2-py3-none-any.whl
RUN datasette build_metadata {} --metadata metadata.json
EXPOSE 8006
CMD ["datasette", "serve", {}, "--port", "8006"]'''.format(
CMD ["datasette", "serve", {}, "--port", "8006", "--metadata", "metadata.json"]'''.format(
' '.join(files),
'"' + '", "'.join(files) + '"',
).strip()