2026-04-06 09:12:59 +02:00
|
|
|
# OwnCord Server — developer convenience targets
|
|
|
|
|
#
|
2026-07-19 13:32:58 +00:00
|
|
|
# sqlc-generate Regenerate type-safe Go from sqlc.yaml (db/dbgen).
|
|
|
|
|
# sqlc-verify Fail if the committed dbgen output is stale (used by CI).
|
|
|
|
|
# sqlc-install Install the pinned sqlc version into $GOBIN.
|
|
|
|
|
# protocol-generate Regenerate WS message-type constants (Go + TS) from docs/protocol-schema.json.
|
|
|
|
|
# protocol-verify Fail if the committed protocol constants are stale (used by CI).
|
|
|
|
|
# otel-up Start Jaeger + Prometheus for local tracing development.
|
|
|
|
|
# otel-down Stop and remove the OTel dev containers.
|
2026-04-06 09:12:59 +02:00
|
|
|
|
|
|
|
|
SQLC_VERSION := $(shell cat sqlc.version)
|
|
|
|
|
|
2026-07-19 13:32:58 +00:00
|
|
|
.PHONY: sqlc-install sqlc-generate sqlc-verify protocol-generate protocol-verify otel-up otel-down
|
2026-04-06 09:12:59 +02:00
|
|
|
|
|
|
|
|
sqlc-install:
|
|
|
|
|
go install github.com/sqlc-dev/sqlc/cmd/sqlc@$(SQLC_VERSION)
|
|
|
|
|
|
|
|
|
|
sqlc-generate:
|
|
|
|
|
sqlc generate
|
|
|
|
|
|
|
|
|
|
sqlc-verify:
|
|
|
|
|
sqlc generate
|
2026-07-18 11:45:30 +02:00
|
|
|
@git diff --exit-code db/dbgen || ( \
|
2026-04-06 07:43:08 +00:00
|
|
|
echo "ERROR: generated sqlc output is stale. Run 'make sqlc-generate' and commit the result." ; \
|
2026-04-06 09:12:59 +02:00
|
|
|
exit 1 ; \
|
|
|
|
|
)
|
2026-04-06 22:48:59 +02:00
|
|
|
|
2026-07-19 13:32:58 +00:00
|
|
|
protocol-generate:
|
|
|
|
|
go run ./scripts/genprotocol
|
|
|
|
|
|
|
|
|
|
protocol-verify:
|
|
|
|
|
go run ./scripts/genprotocol
|
|
|
|
|
@git diff --exit-code ws/message_types.go ../Client/tauri-client/src/lib/protocolTypes.ts || ( \
|
|
|
|
|
echo "ERROR: generated protocol constants are stale. Run 'make protocol-generate' and commit the result." ; \
|
|
|
|
|
exit 1 ; \
|
|
|
|
|
)
|
|
|
|
|
|
2026-04-06 22:48:59 +02:00
|
|
|
# Phase B Step 8 — local OTel development stack.
|
|
|
|
|
# Starts Jaeger (traces) and Prometheus (metrics) in Docker.
|
|
|
|
|
# Jaeger UI: http://localhost:16686
|
|
|
|
|
# Prometheus UI: http://localhost:9090
|
|
|
|
|
# Run the server with: go build -tags otel . && ./owncord-server
|
|
|
|
|
otel-up:
|
|
|
|
|
docker compose -f docker-compose.otel.yml up -d
|
|
|
|
|
|
|
|
|
|
otel-down:
|
|
|
|
|
docker compose -f docker-compose.otel.yml down
|