restructure into "server" and "ui" subdirs

Besides being more clear about what belongs to which, this helps with
docker caching. The server and ui parts are only rebuilt when their
respective subdirectories change.

Extend this a bit further by making the webpack build not depend on
the target architecture. And adding cache dirs so parts of the server
and ui build process can be reused when layer-wide caching fails.
This commit is contained in:
Scott Lamb
2021-01-22 14:43:41 -08:00
parent adcfc5e5f0
commit dd66c7b0dd
100 changed files with 127 additions and 105 deletions

View File

@@ -84,10 +84,6 @@ caveats:
$ docker buildx build --load --platform=arm64/v8 ...
```
Major caveat: something appears to be making `docker buildx build` frequently
redo builds rather than reusing cached results. The author is very annoyed by
this and would welcome help in understanding this problem...
## Non-Docker setup
You may prefer building without Docker on the host. Moonfire NVR should run
@@ -148,13 +144,15 @@ Once prerequisites are installed, you can build the server and find it in
`target/release/moonfire-nvr`:
```
$ cd server
$ cargo test
$ cargo build --release
```
You can build the UI via `yarn` and find it in the `ui-dist` directory:
You can build the UI via `yarn` and find it in the `ui/dist` directory:
```
$ cd ui
$ yarn
$ yarn build
```