check / check (push) Canceled after 0s
make asupdate piped the generator into gzip, so the target saw gzip's exit status. A failed download replaced pkg/asinfo/asdata.json.gz with an empty file and the target still exited 0. The target now runs the new script/asupdate. It writes the generator's output to a temporary file and checks that the generator succeeded and wrote at least one AS. Only then does it compress the list and move it into place. Otherwise it leaves the file alone and exits non-zero. The generator reads as.csv from ipverse/as-metadata, the source's new name. The list it builds there is unchanged, so no new list is committed. Model: opus-5-5
58 lines
1.2 KiB
Makefile
58 lines
1.2 KiB
Makefile
export DEBUG = routewatch
|
|
|
|
# Git revision for version embedding
|
|
GIT_REVISION := $(shell git rev-parse HEAD 2>/dev/null || echo "unknown")
|
|
GIT_REVISION_SHORT := $(shell git describe --tags --always 2>/dev/null || echo "unknown")
|
|
VERSION_PKG := git.eeqj.de/sneak/routewatch/internal/version
|
|
LDFLAGS := -X $(VERSION_PKG).GitRevision=$(GIT_REVISION) -X $(VERSION_PKG).GitRevisionShort=$(GIT_REVISION_SHORT)
|
|
|
|
.PHONY: bootstrap setup check test lint fmt fmt-check docker hooks build clean run asupdate
|
|
|
|
all: test
|
|
|
|
# Install all development dependencies.
|
|
bootstrap:
|
|
@script/bootstrap
|
|
|
|
# Prepare a fresh clone: bootstrap plus pre-commit hook.
|
|
setup:
|
|
@script/setup
|
|
|
|
# Combined pre-commit/CI gate: tests, lint, format check.
|
|
check:
|
|
@script/check
|
|
|
|
test:
|
|
@script/test
|
|
|
|
fmt:
|
|
@script/fmt
|
|
|
|
# Check if code is formatted (read-only).
|
|
fmt-check:
|
|
@script/fmt-check
|
|
|
|
lint:
|
|
@script/lint
|
|
|
|
# Build Docker image.
|
|
docker:
|
|
@script/docker
|
|
|
|
# Install pre-commit hook.
|
|
hooks:
|
|
@script/install-precommit
|
|
|
|
build:
|
|
CGO_ENABLED=1 go build -ldflags "$(LDFLAGS)" -o bin/routewatch cmd/routewatch/main.go
|
|
|
|
clean:
|
|
rm -rf bin/
|
|
|
|
run: build
|
|
DEBUG=routewatch ./bin/routewatch 2>&1 | tee log.txt
|
|
|
|
# Rebuild the AS list built into RouteWatch from as.csv (needs the network).
|
|
asupdate:
|
|
@script/asupdate
|