--secret command for datasette publish

Closes #787
This commit is contained in:
Simon Willison 2020-06-11 09:02:03 -07:00 committed by GitHub
commit 98632f0a87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 58 additions and 14 deletions

View file

@ -247,6 +247,7 @@ def test_temporary_docker_directory_uses_hard_link():
install=[],
spatialite=False,
version_note=None,
secret="secret",
) as temp_docker:
hello = os.path.join(temp_docker, "hello")
assert "world" == open(hello).read()
@ -274,6 +275,7 @@ def test_temporary_docker_directory_uses_copy_if_hard_link_fails(mock_link):
install=[],
spatialite=False,
version_note=None,
secret=None,
) as temp_docker:
hello = os.path.join(temp_docker, "hello")
assert "world" == open(hello).read()
@ -297,11 +299,13 @@ def test_temporary_docker_directory_quotes_args():
install=[],
spatialite=False,
version_note="$PWD",
secret="secret",
) as temp_docker:
df = os.path.join(temp_docker, "Dockerfile")
df_contents = open(df).read()
assert "'$PWD'" in df_contents
assert "'--$HOME'" in df_contents
assert "ENV DATASETTE_SECRET 'secret'" in df_contents
def test_compound_keys_after_sql():