forked from wellCh4n/cattery
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (51 loc) · 2.1 KB
/
Copy pathMakefile
File metadata and controls
64 lines (51 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
.PHONY: dev dev-front dev-back build stop build-harness
GO = $(shell which go)
BUN = $(shell which bun)
DB_URL = postgres://postgres:postgres@localhost:5432/cattery?sslmode=disable
PORT = 8080
K8S_NS = default
# 同时启动前后端
dev:
@echo "→ starting backend on :$(PORT)"
@cd backend && set -a && [ -f .env ] && . ./.env; set +a && \
$(GO) run ./cmd/server/ &
@echo "→ starting frontend on :3000"
@cd web && $(BUN) dev
dev-back:
@echo "→ starting backend on :$(PORT)"
@cd backend && set -a && [ -f .env ] && . ./.env; set +a && \
$(GO) run ./cmd/server/
dev-front:
@echo "→ starting frontend on :3000"
@cd web && $(BUN) dev
build:
@echo "→ building backend"
@cd backend && $(GO) build -o bin/server ./cmd/server/
stop:
@lsof -ti :$(PORT) | xargs kill -9 2>/dev/null && echo "killed :$(PORT)" || echo "nothing on :$(PORT)"
@lsof -ti :3000 | xargs kill -9 2>/dev/null && echo "killed :3000" || echo "nothing on :3000"
migrate:
@/Applications/Postgres.app/Contents/Versions/latest/bin/psql -h localhost -p 5432 -U postgres -d cattery \
-f backend/internal/db/migrations/init.sql
# make build-harness HARNESS=opencode — build one harness
# make build-harness HARNESS=claude-code — build one harness
# make build-harness HARNESS=codex — build one harness
# make build-harness HARNESS=hermes — build one harness
# make build-harness — build all harnesses
HARNESS ?=
build-harness:
$(if $(HARNESS), \
$(MAKE) _build-harness-$(HARNESS), \
$(MAKE) _build-harness-opencode _build-harness-claude-code _build-harness-codex _build-harness-hermes)
_build-harness-opencode:
@echo "→ building opencode-sandbox:dev"
@docker build -t opencode-sandbox:dev harnesses/opencode/
_build-harness-claude-code:
@echo "→ building claude-code-sandbox:dev"
@docker build -t claude-code-sandbox:dev harnesses/claude-code/
_build-harness-codex:
@echo "→ building codex-sandbox:dev"
@docker build -t codex-sandbox:dev harnesses/codex/
_build-harness-hermes:
@echo "→ building hermes-sandbox:dev"
@docker build -t hermes-sandbox:dev harnesses/hermes/