Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (62 loc) 路 2.54 KB
/
Copy pathMakefile
File metadata and controls
68 lines (62 loc) 路 2.54 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
65
66
67
.PHONY: all clean protos build-host-agent run-host-agent build-orchestrator run-orchestrator postgres createdb dropdb migrate-up migrate-down
protos:
@echo "Building proto for host-agent"
protoc -I proto \
--go_out=services/common/genproto/host-agents/ \
--go_opt=paths=source_relative \
--go-grpc_out=services/common/genproto/host-agents/ \
--go-grpc_opt=paths=source_relative \
proto/host-agent.proto
@echo "Building proto for registry-monitor"
protoc -I proto \
--go_out=services/common/genproto/registry-monitor/ \
--go_opt=paths=source_relative \
--go-grpc_out=services/common/genproto/registry-monitor/ \
--go-grpc_opt=paths=source_relative \
proto/registry-monitor.proto
@echo "Building proto for tui"
protoc -I proto \
--go_out=services/common/genproto/tui/ \
--go_opt=paths=source_relative \
--go-grpc_out=services/common/genproto/tui/ \
--go-grpc_opt=paths=source_relative \
proto/tui.proto
run-host-agent:
@echo "Running host-agent"
go build -o ./services/host-agent/build ./services/host-agent/cmd/agent/main.go
./services/host-agent/build -o localhost:50051
run-orchestrator:
@echo "Running orchestrator"
go build -o ./services/orchestrator/build ./services/orchestrator/cmd/orchestrator/main.go
./services/orchestrator/build -config local.yaml
run-registry-monitor:
@echo "Running registry-monitor"
go build -o ./services/registry-monitor/build ./services/registry-monitor/cmd/monitor/main.go
./services/registry-monitor/build
run-tui:
@echo "Running TUI"
go build -o ./services/tui/build ./services/tui/cmd/tui/main.go
./services/tui/build -o localhost:50051
postgres:
@echo "Running postgres"
docker run --rm -d --name dbLighthouse -e POSTGRES_USER=dev -e POSTGRES_PASSWORD=dev -p 5432:5432 postgres:13.22-alpine3.22
createdb:
@echo "Creating database"
docker exec -it dbLighthouse createdb -U dev lighthouse
dropdb:
@echo "Dropping database"
docker exec -it dbLighthouse dropdb -U dev lighthouse
migrate-up:
@echo "Running migrations up"
migrate -path ./services/orchestrator/db/migration/ -database "postgres://dev:dev@localhost:5432/lighthouse?sslmode=disable" -verbose up
migrate-down:
@echo "Running migrations down"
migrate -path ./services/orchestrator/db/migration/ -database "postgres://dev:dev@localhost:5432/lighthouse?sslmode=disable" -verbose down
sqlc/orchestrator:
@echo "=> Generating sqlc code for orchestrator..."
sqlc generate -f services/orchestrator/sqlc.yaml
make-db:
@echo "Setting up the database"
make postgres
make createdb
make migrate-up