-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (43 loc) · 1.12 KB
/
Makefile
File metadata and controls
57 lines (43 loc) · 1.12 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
# set mac-only linker flags only for go test (not global)
UNAME_S := $(shell uname -s)
TEST_ENV :=
ifeq ($(UNAME_S),Darwin)
TEST_ENV = CGO_LDFLAGS=-w
endif
TEST_FLAGS := -race -count=1
.PHONY: build-lambda
build-lambda:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o dist/bootstrap ./cmd/lambda
.PHONY: build-server
build-server:
CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o dist/server ./cmd/server
.PHONY: build-debug
build-debug:
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -trimpath -ldflags "-s -w" -o dist/sample ./cmd/sample
.PHONY: debug
debug:
go run ./cmd/sample
.PHONY: server
server:
go run ./cmd/server
.PHONY: test
test:
$(TEST_ENV) go test $(TEST_FLAGS) ./...
.PHONY: test-unit
test-unit:
$(TEST_ENV) go test $(TEST_FLAGS) ./internal/...
.PHONY: test-verify
test-verify:
go run ./cmd/verify
.PHONY: test-verify-verbose
test-verify-verbose:
go run ./cmd/verify -verbose
.PHONY: server-up
server-up:
docker compose up -d --build
.PHONY: server-logs
server-logs:
docker compose logs -f server
.PHONY: server-stop
server-stop:
docker compose down --rmi local --remove-orphans