-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (82 loc) · 2.76 KB
/
Copy pathMakefile
File metadata and controls
95 lines (82 loc) · 2.76 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
.PHONY: build clean lint test run-publisher run-ssp run-dsp1 run-dsp2 run-adx run-adview run-ctv run-all stop
# Build all Go binaries
build:
cd publisher && go build -o publisher .
cd ssp && go build -o ssp .
cd dsp && go build -o dsp .
cd adx && go build -o adx .
cd adview && go build -o adview .
cd ctv && go build -o ctv .
# Run individual components
run-publisher:
cd publisher && go run .
run-ssp:
cd ssp && go run .
run-dsp1:
cd dsp && DSP_PORT=8092 DSP_NAME=dsp-alpha go run .
run-dsp2:
cd dsp && DSP_PORT=8093 DSP_NAME=dsp-beta go run .
run-adx:
cd adx && ADX_PORT=8094 go run .
run-adview:
cd adview && go run .
run-ctv:
cd ctv && go run .
# Run all components in background
run-all: build
@echo "Starting AdView Visualizer on :8095..."
@cd adview && nohup ./adview > adview.log 2>&1 &
@echo "Starting DSP #1 on :8092..."
@cd dsp && DSP_PORT=8092 DSP_NAME=dsp-alpha nohup ./dsp > dsp-alpha.log 2>&1 &
@echo "Starting DSP #2 on :8093..."
@cd dsp && DSP_PORT=8093 DSP_NAME=dsp-beta nohup ./dsp > dsp-beta.log 2>&1 &
@sleep 1
@echo "Starting SSP on :8091..."
@cd ssp && nohup ./ssp > ssp.log 2>&1 &
@echo "Starting Ad Exchange (ADX) on :8094..."
@cd adx && nohup ./adx > adx.log 2>&1 &
@sleep 1
@echo "Starting Publisher on :8090..."
@cd publisher && nohup ./publisher > publisher.log 2>&1 &
@echo "Starting CTV Publisher on :8096..."
@cd ctv && nohup ./ctv > ctv.log 2>&1 &
@echo ""
@echo "All components running:"
@echo " Publisher: http://localhost:8090"
@echo " CTV Publisher: http://localhost:8096"
@echo " SSP Admin: http://localhost:8091/admin"
@echo " DSP #1 Admin: http://localhost:8092/admin"
@echo " DSP #2 Admin: http://localhost:8093/admin"
@echo " ADX Admin: http://localhost:8094/admin"
@echo " AdView Visualizer: http://localhost:8095"
@echo ""
@echo "Run 'make stop' to stop all components."
# Stop all running components
stop:
@-lsof -t -i :8090 | xargs kill -9 2>/dev/null || true
@-lsof -t -i :8091 | xargs kill -9 2>/dev/null || true
@-lsof -t -i :8092 | xargs kill -9 2>/dev/null || true
@-lsof -t -i :8093 | xargs kill -9 2>/dev/null || true
@-lsof -t -i :8094 | xargs kill -9 2>/dev/null || true
@-lsof -t -i :8095 | xargs kill -9 2>/dev/null || true
@-lsof -t -i :8096 | xargs kill -9 2>/dev/null || true
@echo "All components stopped."
# Clean build artifacts
clean:
rm -f publisher/publisher ssp/ssp dsp/dsp adx/adx adview/adview ctv/ctv
# Lint all Go modules
lint:
cd publisher && go vet ./...
cd ssp && go vet ./...
cd dsp && go vet ./...
cd adx && go vet ./...
cd adview && go vet ./...
cd ctv && go vet ./...
# Run all unit tests
test:
cd publisher && go test -v ./...
cd ssp && go test -v ./...
cd dsp && go test -v ./...
cd adx && go test -v ./...
cd adview && go test -v ./...
cd ctv && go test -v ./...