-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (56 loc) · 1.78 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
GOBIN=$(GOPATH)/bin
GORUN=go run
GOBUILD=go build
GOTEST=go test
include .env
export
PROJECT_DIR=$(shell pwd)
EXAMPLES_DIR=$(PROJECT_DIR)/specs
CONTRACTOR=$(PROJECT_DIR)/cmd/contractor/main.go
clean:
find $(PROJECT_DIR) \( -path "*/mocks" -and ! -path "*/vendor/*" \) -exec rm -rf {} +
rm -rf $(PROJECT_DIR)/vendor
install:
GOPROXY=direct GOSUMDB=off go mod vendor
build:
go install ./...
echo $(GOPATH)
echo $(GOBIN)
ls -la $(GOBIN)
test:
$(GOTEST) -v ./...
generate:
go generate ./...
update: clean install generate
generate-graylog-client:
rm -rf $(PROJECT_DIR)/tester/graylog/client
mkdir -p $(PROJECT_DIR)/tester/graylog/client
swagger generate client \
-m client/models \
-f $(EXAMPLES_DIR)/graylog.json \
-t $(PROJECT_DIR)/tester/graylog
run-tester:
$(GORUN) $(CONTRACTOR) -m test \
-c $(PROJECT_DIR)/config.yml \
-s /Users/solomonov/GolandProjects/src/git.setpartnerstv.ru/meta/proto/swagger.yml \
-u $(URL_BASE) \
-f $(SPEC_TYPE) \
-t b2e \
-v "VAR_HEADER_AUTHORIZATION:$(VAR_HEADER_AUTHORIZATION)" \
-v "VAR_HEADER_ERP_AUTHORIZATION:$(VAR_HEADER_ERP_AUTHORIZATION)" \
-v "VAR_STATUS_CODE_SUCCESS:$(VAR_STATUS_CODE_SUCCESS)" \
-v "VAR_STATUS_CODE_FORBIDDEN:$(VAR_STATUS_CODE_FORBIDDEN)" \
-v "VAR_STATUS_CODE_NOT_FOUND:$(VAR_STATUS_CODE_NOT_FOUND)" \
-v "VAR_STATUS_CODE_INVALID_PARAM:$(VAR_STATUS_CODE_INVALID_PARAM)" \
-v "VAR_STATUS_CODE_INVALID:$(VAR_STATUS_CODE_INVALID)" \
-v "VAR_USER_CUSTOMER_ACTIVE:$(VAR_USER_CUSTOMER_ACTIVE)"
run-tester2:
$(GORUN) $(CONTRACTOR) -m test2 \
-c $(PROJECT_DIR)/config.yml
run-mocker:
$(GORUN) $(CONTRACTOR) -m mock \
-c $(PROJECT_DIR)/config.yml \
-s $(EXAMPLES_DIR)/oa2.yml \
-u $(URL_BASE) \
-f $(SPEC_TYPE) \
-v "VAR_AUTHORIZATION:$(VAR_AUTHORIZATION)"