Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79a63408f0 |
+5
-4
@@ -30,11 +30,12 @@ COPY backend/ .
|
|||||||
|
|
||||||
RUN make test
|
RUN make test
|
||||||
|
|
||||||
# make build is a shim around backend/script/build, the one definition
|
# The build is driven through the Makefile so there is exactly one
|
||||||
# of the build command:
|
# definition of the build command; it expands to
|
||||||
# CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.Version=... -X main.Buildarch=..."
|
# CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.Version=... -X main.Buildarch=..."
|
||||||
# That script reads VERSION from the environment, so it is handed over
|
# VERSION is handed over in the environment rather than as a make
|
||||||
# there rather than as a make variable.
|
# variable so it still reaches the build if the target is ever turned
|
||||||
|
# into a shim around a script.
|
||||||
ARG VERSION=dev
|
ARG VERSION=dev
|
||||||
RUN VERSION="${VERSION}" make build
|
RUN VERSION="${VERSION}" make build
|
||||||
|
|
||||||
|
|||||||
@@ -45,8 +45,7 @@ halves, so the root `make check` fails if either one is broken. We provide:
|
|||||||
- `script/setup` — make a fresh clone ready for development: bootstrap plus the
|
- `script/setup` — make a fresh clone ready for development: bootstrap plus the
|
||||||
git pre-commit hook
|
git pre-commit hook
|
||||||
- `script/projectname` — print the project name (used for the Docker image tags)
|
- `script/projectname` — print the project name (used for the Docker image tags)
|
||||||
- `script/test` — run `script/frontend-test`, then the backend's Go tests, both
|
- `script/test` — run `script/frontend-test`, then the backend's Go tests
|
||||||
within one 30-second timeout
|
|
||||||
- `script/lint` — run `script/frontend-lint`, then golangci-lint in Docker, by
|
- `script/lint` — run `script/frontend-lint`, then golangci-lint in Docker, by
|
||||||
building the lint stage of `Dockerfile.backend` without the cache
|
building the lint stage of `Dockerfile.backend` without the cache
|
||||||
- `script/fmt` — format all files (writes): prettier, then gofmt over `backend/`
|
- `script/fmt` — format all files (writes): prettier, then gofmt over `backend/`
|
||||||
|
|||||||
@@ -32,9 +32,8 @@ latest run passes.
|
|||||||
`Dockerfile.backend` without the cache. `script/bootstrap` installs the pinned
|
`Dockerfile.backend` without the cache. `script/bootstrap` installs the pinned
|
||||||
Go unless the installed one is at least what `backend/go.mod` asks for, links
|
Go unless the installed one is at least what `backend/go.mod` asks for, links
|
||||||
what it installs into `~/.local/bin` without replacing anything it did not
|
what it installs into `~/.local/bin` without replacing anything it did not
|
||||||
create, and installs no linter. Root `make test` runs both halves within one
|
create, and installs no linter. The backend binary's version falls back to
|
||||||
30-second timeout. When `VERSION` is unset or empty, the backend binary's
|
`dev` when `VERSION` is unset or empty
|
||||||
version falls back to `git describe` inside a git checkout, then to `dev`
|
|
||||||
- 2026-09-28: frontend reporting client (issue #53): a `Reporter` class posts
|
- 2026-09-28: frontend reporting client (issue #53): a `Reporter` class posts
|
||||||
collected samples to `/api/v1/reports` every `reportInterval` (default 60s) as
|
collected samples to `/api/v1/reports` every `reportInterval` (default 60s) as
|
||||||
a per-host delta, with the report-building step a pure exported function of
|
a per-host delta, with the report-building step a pure exported function of
|
||||||
|
|||||||
+2
-3
@@ -31,9 +31,8 @@ pattern as the repo root: the targets in `backend/Makefile` are thin shims over
|
|||||||
`test`, `fmt` and `fmt-check`:
|
`test`, `fmt` and `fmt-check`:
|
||||||
|
|
||||||
- `script/build` — compile the static `netwatch-server` binary with its version
|
- `script/build` — compile the static `netwatch-server` binary with its version
|
||||||
and architecture stamped in. The version is `VERSION` from the environment;
|
and architecture stamped in. The version is `VERSION` from the environment,
|
||||||
when that is unset or empty, it falls back to `git describe` inside a git
|
else `git describe`, else `dev`
|
||||||
checkout, then to `dev`
|
|
||||||
- `script/test` — run the Go tests under a 30-second timeout
|
- `script/test` — run the Go tests under a 30-second timeout
|
||||||
- `script/lint` — check `.golangci.yml` against its pinned sha256, then run
|
- `script/lint` — check `.golangci.yml` against its pinned sha256, then run
|
||||||
golangci-lint. It runs inside the golangci-lint image of the lint stage of
|
golangci-lint. It runs inside the golangci-lint image of the lint stage of
|
||||||
|
|||||||
+3
-3
@@ -1,14 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# script/test: run the test suite for the whole repo: the frontend at
|
# script/test: run the test suite for the whole repo: the frontend at
|
||||||
# the repo root, then the Go backend in backend/. Both halves together
|
# the repo root, then the Go backend in backend/.
|
||||||
# get 30 seconds; each also keeps its own limit for the Dockerfiles.
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
|
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
cd "$ROOT"
|
cd "$ROOT"
|
||||||
timeout 30 sh -c 'script/frontend-test && backend/script/test'
|
"$ROOT/script/frontend-test"
|
||||||
|
"$ROOT/backend/script/test"
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user