generated from Yandex-Practicum/go-musthave-metrics-tpl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
149 lines (146 loc) · 5.57 KB
/
Makefile
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# Params to test
SERVER_PORT=8080
TEMP_FILE=/tmp/metrics.json
DATABASE_DSN=postgres://postgres:metrics@localhost:5432/metrics?sslmode=disable
all: build vet iter1 iter2 iter3 iter4 iter5 iter6 iter7 iter8 iter9 iter10 iter11 iter12 iter13 iter14
test: build vet iter11 iter12
build:
go build -C cmd/agent -o agent -ldflags="-X main.buildVersion=v0.0.1 -X main.buildDate=$(shell date -u +%Y-%m-%dT%H:%M:%S) -X main.buildCommit=$(shell git rev-parse HEAD)"
go build -C cmd/server -o server -ldflags "-X main.buildVersion=v0.0.1 -X main.buildDate=$(shell date -u +%Y-%m-%dT%H:%M:%S) -X main.buildCommit=$(shell git rev-parse HEAD)"
go build -C cmd/staticlint -o staticlint
vet:
goimports -local "github.com/arxon31/metrics-collector" -w /Users/arxon31/go/src/github.com/arxon31/metrics-collector/
go vet -vettool=statictest-darwin-arm64 ./...
iter1:
./metricstest-darwin-arm64 -test.v -test.run=^TestIteration1$$ \
-binary-path=cmd/server/server
iter2:
./metricstest-darwin-arm64 -test.v -test.run=^TestIteration2[AB]*$ \
-source-path=. \
-agent-binary-path=cmd/agent/agent
iter3:
./metricstest-darwin-arm64 -test.v -test.run=^TestIteration3[AB]*$ \
-source-path=. \
-agent-binary-path=cmd/agent/agent \
-binary-path=cmd/server/server
iter4:
SERVER_PORT=$(SERVER_PORT)
ADDRESS="localhost:$(SERVER_PORT)"
TEMP_FILE=$(TEMP_FILE)
./metricstest-darwin-arm64 -test.v -test.run=^TestIteration4$ \
-agent-binary-path=cmd/agent/agent \
-binary-path=cmd/server/server \
-server-port=$(SERVER_PORT) \
-source-path=.
iter5:
SERVER_PORT=$(SERVER_PORT)
ADDRESS="localhost:$(SERVER_PORT)"
TEMP_FILE=$(TEMP_FILE)
./metricstest-darwin-arm64 -test.v -test.run=^TestIteration5$ \
-agent-binary-path=cmd/agent/agent \
-binary-path=cmd/server/server \
-server-port=$(SERVER_PORT) \
-source-path=.
iter6:
SERVER_PORT=$(SERVER_PORT)
ADDRESS="localhost:$(SERVER_PORT)"
TEMP_FILE=$(TEMP_FILE)
./metricstest-darwin-arm64 -test.v -test.run=^TestIteration6$ \
-agent-binary-path=cmd/agent/agent \
-binary-path=cmd/server/server \
-server-port=$(SERVER_PORT) \
-source-path=.
iter7:
SERVER_PORT=$(SERVER_PORT)
ADDRESS="localhost:$(SERVER_PORT)"
TEMP_FILE=$(TEMP_FILE)
./metricstest-darwin-arm64 -test.v -test.run=^TestIteration7$ \
-agent-binary-path=cmd/agent/agent \
-binary-path=cmd/server/server \
-server-port=$(SERVER_PORT) \
-source-path=.
iter8:
SERVER_PORT=$(SERVER_PORT)
ADDRESS="localhost:$(SERVER_PORT)"
TEMP_FILE=$(TEMP_FILE)
./metricstest-darwin-arm64 -test.v -test.run=^TestIteration8$ \
-agent-binary-path=cmd/agent/agent \
-binary-path=cmd/server/server \
-server-port=$(SERVER_PORT) \
-source-path=.
iter9:
SERVER_PORT=$(SERVER_PORT)
ADDRESS="localhost:$(SERVER_PORT)"
TEMP_FILE=$(TEMP_FILE)
./metricstest-darwin-arm64 -test.v -test.run=^TestIteration9$ \
-agent-binary-path=cmd/agent/agent \
-binary-path=cmd/server/server \
-file-storage-path=$(TEMP_FILE) \
-server-port=$(SERVER_PORT) \
-source-path=.
iter10:
docker run --rm -d --name=metricsDB -e=POSTGRES_PASSWORD=metrics -e=POSTGRES_DB=metrics -p 5432:5432 postgres
sleep 2
SERVER_PORT=$(SERVER_PORT)
ADDRESS="localhost:$(SERVER_PORT)"
TEMP_FILE=$(TEMP_FILE)
./metricstest-darwin-arm64 -test.v -test.run=^TestIteration10[AB]$ \
-agent-binary-path=cmd/agent/agent \
-binary-path=cmd/server/server \
-database-dsn=$(DATABASE_DSN) \
-server-port=$(SERVER_PORT) \
-source-path=.
docker stop metricsDB
iter11:
docker run --rm -d --name=metricsDB -e=POSTGRES_PASSWORD=metrics -e=POSTGRES_DB=metrics -p 5432:5432 postgres
sleep 2
SERVER_PORT=$(SERVER_PORT)
ADDRESS="localhost:$(SERVER_PORT)"
TEMP_FILE=$(TEMP_FILE)
./metricstest-darwin-arm64 -test.v -test.run=^TestIteration11$ \
-agent-binary-path=cmd/agent/agent \
-binary-path=cmd/server/server \
-database-dsn=$(DATABASE_DSN) \
-server-port=$(SERVER_PORT) \
-source-path=.
docker stop metricsDB
iter12:
docker run --rm -d --name=metricsDB -e=POSTGRES_PASSWORD=metrics -e=POSTGRES_DB=metrics -p 5432:5432 postgres
sleep 2
SERVER_PORT=$(SERVER_PORT)
ADDRESS="localhost:$(SERVER_PORT)"
TEMP_FILE=$(TEMP_FILE)
./metricstest-darwin-arm64 -test.v -test.run=^TestIteration12$ \
-agent-binary-path=cmd/agent/agent \
-binary-path=cmd/server/server \
-database-dsn=$(DATABASE_DSN) \
-server-port=$(SERVER_PORT) \
-source-path=.
docker stop metricsDB
iter13:
docker run --rm -d --name=metricsDB -e=POSTGRES_PASSWORD=metrics -e=POSTGRES_DB=metrics -p 5432:5432 postgres
sleep 2
SERVER_PORT=$(SERVER_PORT)
ADDRESS="localhost:$(SERVER_PORT)"
TEMP_FILE=$(TEMP_FILE)
./metricstest-darwin-arm64 -test.v -test.run=^TestIteration13$ \
-agent-binary-path=cmd/agent/agent \
-binary-path=cmd/server/server \
-database-dsn=$(DATABASE_DSN) \
-server-port=$(SERVER_PORT) \
-source-path=.
docker stop metricsDB
iter14:
docker run --rm -d --name=metricsDB -e=POSTGRES_PASSWORD=metrics -e=POSTGRES_DB=metrics -p 5432:5432 postgres
sleep 2
SERVER_PORT=$(SERVER_PORT)
ADDRESS="localhost:$(SERVER_PORT)"
TEMP_FILE=$(TEMP_FILE)
./metricstest-darwin-arm64 -test.v -test.run=^TestIteration14$ \
-agent-binary-path=cmd/agent/agent \
-binary-path=cmd/server/server \
-database-dsn=$(DATABASE_DSN) \
-key="$(TEMP_FILE)" \
-server-port=$(SERVER_PORT) \
-source-path=.
docker stop metricsDB