From 195a5b36349d0d24a6bbb758cebb719b6de303b6 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Tue, 5 Feb 2019 20:15:46 -0800 Subject: [PATCH] Heroku --include-vcs-ignore (#407) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Means `datasette publish heroku` can work under Travis, unlike this failure: https://travis-ci.org/simonw/fivethirtyeight-datasette/builds/488047550 ``` 2.25s$ datasette publish heroku fivethirtyeight.db -m metadata.json -n fivethirtyeight-datasette tar: unrecognized option '--exclude-vcs-ignores' Try 'tar --help' or 'tar --usage' for more information. ▸ Command failed: tar cz -C /tmp/tmpuaxm7i8f --exclude-vcs-ignores --exclude ▸ .git --exclude .gitmodules . > ▸ /tmp/f49440e0-1bf3-4d3f-9eb0-fbc2967d1fd4.tar.gz ▸ tar: unrecognized option '--exclude-vcs-ignores' ▸ Try 'tar --help' or 'tar --usage' for more information. ▸ The command "datasette publish heroku fivethirtyeight.db -m metadata.json -n fivethirtyeight-datasette" exited with 0. ``` The fix for that issue is to call the heroku command like this: heroku builds:create -a app_name --include-vcs-ignore --- datasette/publish/heroku.py | 2 +- tests/test_publish_heroku.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/datasette/publish/heroku.py b/datasette/publish/heroku.py index af53a37a..d42f4e83 100644 --- a/datasette/publish/heroku.py +++ b/datasette/publish/heroku.py @@ -96,4 +96,4 @@ def publish_subcommand(publish): create_output = check_output(cmd).decode("utf8") app_name = json.loads(create_output)["name"] - call(["heroku", "builds:create", "-a", app_name]) + call(["heroku", "builds:create", "-a", app_name, "--include-vcs-ignore"]) diff --git a/tests/test_publish_heroku.py b/tests/test_publish_heroku.py index 3d8fb6e6..852403ca 100644 --- a/tests/test_publish_heroku.py +++ b/tests/test_publish_heroku.py @@ -57,7 +57,7 @@ def test_publish_heroku(mock_call, mock_check_output, mock_which): open("test.db", "w").write("data") result = runner.invoke(cli.cli, ["publish", "heroku", "test.db"]) assert 0 == result.exit_code, result.output - mock_call.assert_called_once_with(["heroku", "builds:create", "-a", "f"]) + mock_call.assert_called_once_with(["heroku", "builds:create", "-a", "f", "--include-vcs-ignore"]) @mock.patch("shutil.which")