purescript / registry-dev

Development work related to the PureScript Registry
https://github.com/purescript/registry
97 stars 80 forks source link

Build and run the server via Nix #608

Closed thomashoneyman closed 1 year ago

thomashoneyman commented 1 year ago

This PR is a first cut at packaging the registry server and running it via Nix. Doing it via Nix means that we can do Nix-based deployments to our NixOS server, giving us access to all the niceties of a Nix server (namely, easy deployments and rollbacks).

Marking as a draft for now because this is quite ugly and I need to do more work to make it readable and convenient to use. That said: you can run the server with this command (if you have Nix):

nix run github:purescript/registry-dev/trh/nix-build

You should see some build output and then the server will start up:

 ┌───────────────────────────────────────────┐
 │ Server now up on port 8080                │
 │                                           │
 │ To test, run:                             │
 │  > curl -v localhost:8080/api/v1/jobs/0   │
 └───────────────────────────────────────────┘

And, accordingly, you can curl that endpoint to get output. Voila!

thomashoneyman commented 1 year ago

See #618