{"html_url": "https://github.com/simonw/datasette/issues/675#issuecomment-751826749", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/675", "id": 751826749, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MTgyNjc0OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-28T18:49:21Z", "updated_at": "2020-12-28T18:49:21Z", "author_association": "OWNER", "body": "That `--exec` could help solve all sorts of other problems too, like needing to `apt-get install` extra packages or download files from somewhere using `wget`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 567902704, "label": "--cp option for datasette publish and datasette package for shipping additional files and directories"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/675#issuecomment-751826621", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/675", "id": 751826621, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MTgyNjYyMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-28T18:48:51Z", "updated_at": "2020-12-28T18:48:51Z", "author_association": "OWNER", "body": "I could make `--include` work if I also had a mechanism for running some shell commands inside the container at the end of the build - which users could then use to move files into the correct place.\r\n\r\n datasette publish cloudrun my.db --include src/ --exec 'mv /app/src/config.yml /etc/conf/config.yml'", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 567902704, "label": "--cp option for datasette publish and datasette package for shipping additional files and directories"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/675#issuecomment-747070709", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/675", "id": 747070709, "node_id": "MDEyOklzc3VlQ29tbWVudDc0NzA3MDcwOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-16T22:09:15Z", "updated_at": "2020-12-16T22:09:15Z", "author_association": "OWNER", "body": "The other way this could work is passing a single argument - the file (or directory) to be copied in - and assuming it should always go in the `/app` root. Something like:\r\n\r\n datasette publish cloudrun my.db --include src/ --include dogsheep-beta.yml\r\n\r\nWhich would add `/app/src/...` and `/app/dogsheep-beta.yml`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 567902704, "label": "--cp option for datasette publish and datasette package for shipping additional files and directories"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/675#issuecomment-747068624", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/675", "id": 747068624, "node_id": "MDEyOklzc3VlQ29tbWVudDc0NzA2ODYyNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-16T22:04:42Z", "updated_at": "2020-12-16T22:04:42Z", "author_association": "OWNER", "body": "I can't just use `COPY /path/to/blah.yml /app` in the `Dockerfile` because it runs on the Google Cloud Build servers, not on the user's laptop - so I need to first copy the files they specify to that temporary directory that gets uploaded to the cloud, then rewrite the `COPY` lines in the `Dockerfile` to copy from there.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 567902704, "label": "--cp option for datasette publish and datasette package for shipping additional files and directories"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/675#issuecomment-747067864", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/675", "id": 747067864, "node_id": "MDEyOklzc3VlQ29tbWVudDc0NzA2Nzg2NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-16T22:02:55Z", "updated_at": "2020-12-16T22:02:55Z", "author_association": "OWNER", "body": "But since we're already running `COPY . /app` anything that's made it into the temporary directory will get copied into `/app`.\r\n\r\nBut... I feel the usability of the command will be better if users can use absolute paths on the `target` side:\r\n\r\n datasette publish cloudrun my.db --cp dogsheep-beta.yml /app", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 567902704, "label": "--cp option for datasette publish and datasette package for shipping additional files and directories"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/675#issuecomment-747066629", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/675", "id": 747066629, "node_id": "MDEyOklzc3VlQ29tbWVudDc0NzA2NjYyOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-16T21:59:58Z", "updated_at": "2020-12-16T22:00:48Z", "author_association": "OWNER", "body": "Note that `datasette publish cloudrun` uses a working directory of `/app` - so users will need to copy their files into `/app` if that's where they need to live.\r\n\r\nhttps://github.com/simonw/datasette/blob/17cbbb1f7f230b39650afac62dd16476626001b5/datasette/utils/__init__.py#L348-L357", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 567902704, "label": "--cp option for datasette publish and datasette package for shipping additional files and directories"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/675#issuecomment-747059277", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/675", "id": 747059277, "node_id": "MDEyOklzc3VlQ29tbWVudDc0NzA1OTI3Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-16T21:43:52Z", "updated_at": "2020-12-16T21:43:52Z", "author_association": "OWNER", "body": "It turns out I need this for a couple of projects:\r\n\r\n- [datasette-ripgrep](https://github.com/simonw/datasette-ripgrep) needs to ship a whole bunch of source code files up in a known location. I worked around this with a nasty hack involving `--static` but it would be better if I wasn't doing that.\r\n- [dogsheep-beta](https://github.com/dogsheep/dogsheep-beta) uses an additional `dogsheep-beta.yml` configuration file in the project root (a sibling to `metadata.yml`) which needs to be included when publishing - see https://github.com/simonw/datasette.io/issues/21#issuecomment-747058067\r\n\r\nI want this for `datasette publish cloudrun`, not just for `datasette package`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 567902704, "label": "--cp option for datasette publish and datasette package for shipping additional files and directories"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/675#issuecomment-592399256", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/675", "id": 592399256, "node_id": "MDEyOklzc3VlQ29tbWVudDU5MjM5OTI1Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-02-28T08:09:12Z", "updated_at": "2020-02-28T08:09:12Z", "author_association": "OWNER", "body": "Sure, `--cp` looks good to me.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 567902704, "label": "--cp option for datasette publish and datasette package for shipping additional files and directories"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/675#issuecomment-590593247", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/675", "id": 590593247, "node_id": "MDEyOklzc3VlQ29tbWVudDU5MDU5MzI0Nw==", "user": {"value": 141844, "label": "aviflax"}, "created_at": "2020-02-24T23:02:52Z", "updated_at": "2020-02-24T23:02:52Z", "author_association": "NONE", "body": "> Design looks great to me.\r\n\r\nExcellent, thanks!\r\n\r\n> I'm not keen on two letter short versions (`-cp`) - I'd rather either have a single character or no short form at all.\r\n\r\nHmm, well, anyone running `datasette package` is probably at least somewhat familiar with UNIX CLIs\u2026 so how about `--cp` as a middle ground?\r\n\r\n```shell\r\n$ datasette package --cp /the/source/path /the/target/path data.db\r\n```\r\n\r\nI think I like it. Easy to remember!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 567902704, "label": "--cp option for datasette publish and datasette package for shipping additional files and directories"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/675#issuecomment-590539805", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/675", "id": 590539805, "node_id": "MDEyOklzc3VlQ29tbWVudDU5MDUzOTgwNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-02-24T20:44:59Z", "updated_at": "2020-02-24T20:45:08Z", "author_association": "OWNER", "body": "Design looks great to me.\r\n\r\nI'm not keen on two letter short versions (`-cp`) - I'd rather either have a single character or no short form at all. ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 567902704, "label": "--cp option for datasette publish and datasette package for shipping additional files and directories"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/675#issuecomment-590405736", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/675", "id": 590405736, "node_id": "MDEyOklzc3VlQ29tbWVudDU5MDQwNTczNg==", "user": {"value": 141844, "label": "aviflax"}, "created_at": "2020-02-24T16:06:27Z", "updated_at": "2020-02-24T16:06:27Z", "author_association": "NONE", "body": "> So yeah - if you're happy to design this I think it would be worth us adding.\r\n\r\nGreat! I\u2019ll give it a go.\r\n\r\n\r\n\r\n> Small design suggestion: allow `--copy` to be applied multiple times\u2026\r\n\r\nMakes a ton of sense, will do.\r\n\r\n> Also since Click arguments can take multiple options I don't think you need to have the `:` in there - although if it better matches Docker's own UI it might be more consistent to have it.\r\n\r\nGreat point. I double checked the docs for `docker cp` and in that context the colon is used to delimit a container and a path, while spaces are used to separate the source and target.\r\n\r\nThe usage string is:\r\n\r\n```text\r\ndocker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-\r\ndocker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH\r\n```\r\n\r\nso in fact it\u2019ll be more consistent to use a space to delimit the source and destination paths, like so:\r\n\r\n```shell\r\n$ datasette package --copy /the/source/path /the/target/path data.db\r\n```\r\n\r\nand I suppose the short-form version of the option should be `cp` like so:\r\n\r\n```shell\r\n$ datasette package -cp /the/source/path /the/target/path data.db\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 567902704, "label": "--cp option for datasette publish and datasette package for shipping additional files and directories"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/675#issuecomment-589908912", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/675", "id": 589908912, "node_id": "MDEyOklzc3VlQ29tbWVudDU4OTkwODkxMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-02-22T02:38:21Z", "updated_at": "2020-02-22T02:38:21Z", "author_association": "OWNER", "body": "Interesting feature suggestion.\r\n\r\nMy initial instinct was that this would be better handled using the layered nature of Docker - so build a Docker image with `datasette package` and then have a separate custom script which takes that image, copies in the extra data and outputs a new image.\r\n\r\nBut... `datasette package` is already meant to be more convenient than messing around with Docker by hand like this - so actually having a `--copy` option like you describe here feels like it's within scope of what `datasette package` is meant to do.\r\n\r\nSo yeah - if you're happy to design this I think it would be worth us adding.\r\n\r\nSmall design suggestion: allow `--copy` to be applied multiple times, so you can do something like this:\r\n\r\n datasette package \\\r\n --copy ~/project/templates /templates \\\r\n --copy ~/project/README.md /README.md \\\r\n data.db\r\n\r\nAlso since Click arguments can take multiple options I don't think you need to have the `:` in there - although if it better matches Docker's own UI it might be more consistent to have it.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 567902704, "label": "--cp option for datasette publish and datasette package for shipping additional files and directories"}, "performed_via_github_app": null}