-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
128 lines (100 loc) · 2.57 KB
/
Makefile
File metadata and controls
128 lines (100 loc) · 2.57 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
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
# Go parameters
GOCMD=go
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOMOD=$(GOCMD) mod
GOBUILD=$(GOCMD) build
GORUN=$(GOCMD) run
WRITE_API_SERVER_BASE_URL=http://localhost:28080
READ_API_SERVER_BASE_URL=http://localhost:28082
.PHONY: all
all: test
.PHONY: test
test:
$(GOTEST) -v ./...
.PHONY: clean
clean:
$(GOMOD) tidy
rm -rf ./testdata
.PHONY: deps
deps:
$(GOGET) -u
.PHONY: lint
lint:
staticcheck ./...
.PHONY: vet
vet:
$(GOCMD) vet ./...
.PHONY: fmt
fmt:
gofmt -s -w .
.PHONY: tidy
tidy:
$(GOMOD) tidy
# Run all code checks
.PHONY: check
check: lint vet fmt test
# Download all dependencies
prepare:
$(GOMOD) download
# Update all dependencies
update:
$(GOMOD) tidy
$(GOMOD) download
build:
$(GOBUILD)
c-gql-init:
@echo "Initializing GraphQL code for command..."
$(GORUN) github.com/99designs/gqlgen init --config pkg/command/interfaceAdaptor/gqlgen.yml
$(GOMOD) tidy
c-gql-gen:
@echo "Generating GraphQL code for command..."
$(GORUN) github.com/99designs/gqlgen generate --config pkg/command/interfaceAdaptor/gqlgen.yml
$(GOMOD) tidy
q-gql-init:
@echo "Initializing GraphQL code..."
$(GORUN) github.com/99designs/gqlgen init --config pkg/query/interfaceAdaptor/gqlgen.yml
$(GOMOD) tidy
q-gql-gen:
@echo "Generating GraphQL code..."
$(GORUN) github.com/99designs/gqlgen generate --config pkg/query/interfaceAdaptor/gqlgen.yml
$(GOMOD) tidy
.PHONY: run-write-api-server
run-write-api-server:
AWS_REGION=ap-northeast-1 \
AWS_DYNAMODB_ENDPOINT_URL=http://localhost:28000 \
AWS_DYNAMODB_ACCESS_KEY_ID=x \
AWS_DYNAMODB_SECRET_ACCESS_KEY=x \
$(GORUN) main.go writeApi
.PHONY: run-read-api-server
run-read-api-server:
AWS_REGION=ap-northeast-1 \
DATABASE_URL='ceer:ceer@tcp(localhost:23306)/ceer' \
$(GORUN) main.go readApi
.PHONY: docker-build
docker-build:
docker build -t cqrs-es-example-go:latest -f Dockerfile .
.PHONY: docker-build-rmu
docker-build-rmu:
docker build -t cqrs-es-example-go-rmu:latest -f Dockerfile.rmu .
.PHONY: docker-compose-up
docker-compose-up:
./tools/scripts/docker-compose-up.sh
.PHONY: docker-compose-up-db
docker-compose-up-db:
./tools/scripts/docker-compose-up.sh -d
.PHONY: docker-compose-ps
docker-compose-ps:
./tools/scripts/docker-compose-ps.sh
.PHONY: docker-compose-down
docker-compose-down:
./tools/scripts/docker-compose-down.sh
.PHONY: verify-group-chat
verify-group-chat:
./tools/e2e-test/verify-group-chat.sh
.PHONY: docker-build-e2e-test
docker-build-e2e-test:
cd ./tools/e2e-test && make build
.PHONY: docker-compose-e2e-test
docker-compose-ci: docker-build-e2e-test docker-build
./tools/scripts/docker-compose-e2e-test.sh