nginx failed at start with mkdir() /var/lib/nginx/tmp/client_body (13: Permission denied) because the root file system is read-only. Mount emptyDirs on /var/lib/nginx/tmp, /run (the pid file; /var/run is only a symlink to it) and /tmp, drop the unused /var/cache/nginx mount, and make CI and make lint-chart fail if one of them goes missing. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qu4xuNCkFLDByYWUrjanny
28 lines
943 B
Makefile
28 lines
943 B
Makefile
.PHONY: test test-backend test-frontend lint-chart swagger run build
|
|
|
|
test: test-backend test-frontend
|
|
|
|
test-backend:
|
|
cd backend && go test ./...
|
|
|
|
test-frontend:
|
|
cd frontend && pnpm test
|
|
|
|
lint-chart:
|
|
helm lint deploy/helm/timetracker --strict --set secrets.inline.jwtSecret=ci
|
|
helm template ci deploy/helm/timetracker --set secrets.inline.jwtSecret=ci > /dev/null
|
|
# nginx runs on a read-only root file system and writes only to these paths
|
|
for path in /var/lib/nginx/tmp /run /tmp; do \
|
|
helm template ci deploy/helm/timetracker --set secrets.inline.jwtSecret=ci | grep -q "mountPath: $$path$$" \
|
|
|| { echo "frontend pod has no writable $$path"; exit 1; }; \
|
|
done
|
|
|
|
swagger:
|
|
cd backend && go run github.com/swaggo/swag/cmd/swag@v1.16.6 init -g cmd/server/main.go -o docs --parseDependency --parseInternal
|
|
|
|
run:
|
|
cd backend && go run ./cmd/server
|
|
|
|
build:
|
|
cd backend && go build -o bin/server ./cmd/server
|
|
cd frontend && pnpm build
|