simonw / datasette-publish-fly

Datasette plugin for publishing data using Fly
Apache License 2.0
20 stars 7 forks source link

`--generate-dir` option #13

Closed simonw closed 2 years ago

simonw commented 2 years ago

I'm going to imitate datasette publish vercel which has this option:

--generate-dir DIRECTORY        Output generated application files and stop
without deploying

Originally posted by @simonw in https://github.com/simonw/datasette-publish-fly/issues/12#issuecomment-1022637223

simonw commented 2 years ago

Manually tested this like so:

% datasette publish fly ../datasette/fixtures.db -a my-fixtures-generated -m ../datasette/metadata.json --generate-dir=/tmp/deploy-this
% cd /tmp/deploy-this 
% ls
Dockerfile  fixtures.db fly.toml    metadata.json
% flyctl apps create my-fixtures-generated 
automatically selected personal organization: Simon Willison
New app created: my-fixtures-generated
% flyctl deploy                                              
Update available 0.0.288 -> v0.0.289.
Run "flyctl version update" to upgrade.
==> Verifying app config
--> Verified app config
...
--> Building image done
==> Pushing image to fly
The push refers to repository [registry.fly.io/my-fixtures-generated]
84fa04a44c00: Pushed 
...
image: registry.fly.io/my-fixtures-generated:deployment-1643240388
image size: 905 MB
==> Creating release
--> release v2 created

--> You can detach the terminal anytime without stopping the deployment
==> Monitoring deployment

v0 is being deployed
simonw commented 2 years ago

Documentation: https://github.com/simonw/datasette-publish-fly/blob/5b0b082ea6c232e35b50d6f1189b99ae77d061d2/README.md#generating-without-deploying

simonw commented 2 years ago

https://my-fixtures-generated.fly.dev/ started working about three minutes after I ran the deploy.

simonw commented 2 years ago

Now deleting the test app:

% flyctl apps destroy my-fixtures-generated --yes
Destroyed app my-fixtures-generated