-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
64 lines (43 loc) · 1.52 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
BUILD_COMMIT=$(shell git rev-list -1 HEAD)
BUILD_DATE=$(shell date +%d-%m-%Y-%H:%M)
VERSION=$(shell build/get_version.sh)
LDFLAGS="-s -w -X main.version=$(VERSION) -X main.commit=$(BUILD_COMMIT) -X main.date=$(BUILD_DATE)"
fdb_file=$(shell pwd)/fdb.cluster
cache:
go mod tidy
go mod vendor
build:
go build -ldflags=$(LDFLAGS) -o bin/stroppy ./cmd/stroppy
.PHONY: build
all: cache build
clean:
rm -rf _data
postgres_pop:
bin/stroppy pop --url postgres://stroppy:stroppy@localhost/stroppy?sslmode=disable --count 5000 -r 1.02
postgres_pay:
bin/stroppy pay --url postgres://stroppy:stroppy@localhost/stroppy?sslmode=disable --check --count=100000 -r 1.02
postgres_payz:
bin/stroppy pay --url postgres://stroppy:stroppy@localhost/stroppy?sslmode=disable --check --count=100000 -z true
fdb_init:
echo "docker:docker@127.0.0.1:4500" > fdb.cluster
fdb_pop:
bin/stroppy pop --url fdb.cluster --count 5000 -d fdb -r 1.02
fdb_pay:
bin/stroppy pay --url fdb.cluster --check --count=100000 -d fdb -r 1.02
fdb_payz:
bin/stroppy pay --url fdb.cluster --check --count=100000 -d fdb -z true
fmt:
gofumpt -w -s .
lint:
go mod vendor
golangci-lint run
deploy_yandex:
bin/stroppy deploy --cloud yandex --flavor small --nodes 3
configure_fdb:
fdbcli -C /var/fdb/fdb.cluster --exec 'configure new single memory'
configure_fdb_local:
fdbcli -C ${fdb_file} --exec 'configure new single memory'
test: configure_fdb lint
TEST_FDB_URL=/var/fdb/fdb.cluster go test ./...
test_local: configure_fdb_local lint
TEST_FDB_URL=${fdb_file} go test ./...