{"html_url": "https://github.com/simonw/datasette/issues/639#issuecomment-559916057", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/639", "id": 559916057, "node_id": "MDEyOklzc3VlQ29tbWVudDU1OTkxNjA1Nw==", "user": {"value": 172847, "label": "pkoppstein"}, "created_at": "2019-11-30T06:08:50Z", "updated_at": "2019-11-30T06:08:50Z", "author_association": "NONE", "body": "@simonw, @jacobian - I was able to resolve the metadata.json issue by adding `-m metadata.json` to the Procfile. Now `git push heroku master` picks up the changes, though I have the impression that heroku is doing more work than necessary (e.g. one of the information messages is: `Installing requirements with pip`).\r\n\r\nI also had to set the environment variable WEB_CONCURRENCY -- I used WEB_CONCURRENCY=1.\r\n\r\nI am still anxious to know whether it's possible for Datasette on Heroku to access the SQLite file at another location. Cloudcube seems the most promising, and I'm hoping it can be done by tweaking the Procfile suitably, but maybe that's too optimistic?\r\n\r\n\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 527670799, "label": "updating metadata.json without recreating the app"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/639#issuecomment-558852316", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/639", "id": 558852316, "node_id": "MDEyOklzc3VlQ29tbWVudDU1ODg1MjMxNg==", "user": {"value": 172847, "label": "pkoppstein"}, "created_at": "2019-11-26T22:54:23Z", "updated_at": "2019-11-26T22:54:23Z", "author_association": "NONE", "body": "@jacobian - Thanks for your help. Having to upload an entire slug each time a small change is needed in `metadata.json` seems no better than the current situation so I probably won't go down that rabbit hole just yet. In any case, the really important goal is moving the SQLite file out of Heroku in a way that the Heroku app can still read it efficiently. Is this possible? Is Cloudcube the right place to start? Is there any alternative? ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 527670799, "label": "updating metadata.json without recreating the app"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/639#issuecomment-558687342", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/639", "id": 558687342, "node_id": "MDEyOklzc3VlQ29tbWVudDU1ODY4NzM0Mg==", "user": {"value": 21148, "label": "jacobian"}, "created_at": "2019-11-26T15:40:00Z", "updated_at": "2019-11-26T15:40:00Z", "author_association": "CONTRIBUTOR", "body": "A bit of background: the reason `heroku git:clone` brings down an empty directory is because `datasette publish heroku` uses the [builds API](https://devcenter.heroku.com/articles/build-and-release-using-the-api), rather than a `git push`, to release the app. I originally did this because it seemed like a lower bar than having a working `git`, but the downside is, as you found out, that tweaking the created app is hard. \r\n\r\nSo there's one option -- change `datasette publish heroku` to use `git push` instead of `heroku builds:create`.\r\n\r\n@pkoppstein - what you suggested seems like it ought to work (you don't need maintenance mode, though). I'm not sure why it doesn't.\r\n\r\nYou could also look into using the [slugs API](https://devcenter.heroku.com/articles/platform-api-deploying-slugs) to download the slug, change `metadata.json`, re-pack and re-upload the slug.\r\n\r\nUltimately though I think I think @simonw's idea of reading `metadata.json` from an external source might be better (#357). Reading from an alternate URL would be fine, or you could also just stuff the whole `metadata.json` into a Heroku config var, and write a plugin to read it from there. \r\n\r\nHope this helps a bit!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 527670799, "label": "updating metadata.json without recreating the app"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/639#issuecomment-558439989", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/639", "id": 558439989, "node_id": "MDEyOklzc3VlQ29tbWVudDU1ODQzOTk4OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-11-26T03:14:27Z", "updated_at": "2019-11-26T03:14:27Z", "author_association": "OWNER", "body": "@jacobian does this sound like something that could work?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 527670799, "label": "updating metadata.json without recreating the app"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/639#issuecomment-558437707", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/639", "id": 558437707, "node_id": "MDEyOklzc3VlQ29tbWVudDU1ODQzNzcwNw==", "user": {"value": 172847, "label": "pkoppstein"}, "created_at": "2019-11-26T03:02:53Z", "updated_at": "2019-11-26T03:03:29Z", "author_association": "NONE", "body": "@simonw - Thanks for the reply!\r\n\r\nMy reading of the heroku documents is that if one sets things up using git, then one can use \"git push\" (from a {local, GitHub, GitLab} git repository to Heroku) to \"update\" a Heroku deployment, but I'm not sure exactly how this works. However, assuming there is some way to use \"git push\" to update the Heroku deployment, the question becomes how can one do this in conjunction with datasette.\r\n\r\nAgain based on my reading the heroku documents, it would seem that the following should work (but it doesn't quite):\r\n\r\n1) Use datasette to create a deployment (named MYAPP)\r\n2) Put it in maintenance mode\r\n3) heroku git:clone -a MYAPP\r\n -- This results in an empty repository (as expected)\r\n4) In another directory, heroku slugs:download -a MYAPP\r\n5) Copy the downloaded slug into the repository\r\n6) Make some change to metadata.json\r\n6) Commit and push it back\r\n7) Take the deployment out of maintenance mode\r\n8) Refresh the deployment\r\n\r\nUsing the heroku console, I've verified that the edits appear on heroku, but somehow they are not reflected in the running app.\r\n\r\nI'm hopeful that with some small tweak or perhaps the addition of a bit of voodoo, this strategy will work. \r\n\r\nI think it will be important to get this working for another reason: getting Heroku, Cloudcube, and datasette to work together, to overcome the slug size limitation so that large SQLite databases can be deployed to Heroku using Datasette.\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 527670799, "label": "updating metadata.json without recreating the app"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/639#issuecomment-558432868", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/639", "id": 558432868, "node_id": "MDEyOklzc3VlQ29tbWVudDU1ODQzMjg2OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-11-26T02:40:06Z", "updated_at": "2019-11-26T02:40:06Z", "author_association": "OWNER", "body": "Unfortunately I don't think it's possible to do this with Heroku. Heroku treats all deployments as total replacements - that's part of how they achieve zero-downtime deployments, since they run the new deployment at the same time as the old deployment and then switch traffic over at the load balancer.\r\n\r\nI did have one idea that's relevant here: #238 - which would provide a mechanism for `metadata.json` to be hosted on a separate URL (e.g. a gist) and have Datasette periodically fetch a new copy. I closed that in favour of #357 - a plugin hook for loading metadata. That's still something I'm interested in exploring.\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 527670799, "label": "updating metadata.json without recreating the app"}, "performed_via_github_app": null}