-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
38 lines (37 loc) · 1.02 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
GOCMD := go
GOBUILD := $(GOCMD) build
GOCLEAN := $(GOCMD) clean
GOTEST := $(GOCMD) test
GOGET := $(GOCMD) get
BUILT := bin
BINARY_SERVER := $(BUILT)/cms-server
BINARY_SEEDER := $(BUILT)/cms-seeder
ifndef GIT_COMMIT
GIT_COMMIT := $(shell echo `git rev-parse HEAD`)
endif
all: test lint build
build-server:
$(GOBUILD) -o ./$(BINARY_SERVER) -ldflags "-X github.com/WeTrustPlatform/charity-management-serv/util.CommitID=$(GIT_COMMIT)" ./cmd/server/main.go
build-seeder:
$(GOBUILD) -o ./$(BINARY_SEEDER) ./cmd/seeder/main.go
build: build-server build-seeder
test:
$(GOTEST) -timeout 500ms -coverprofile cp.out -v ./...
clean:
$(GOCLEAN)
rm -r $(BUILT)
dev: build-server
./live_reload.sh $(BINARY_SERVER) "make build-server"
launch:
./$(BINARY_SERVER)
seeder: build-seeder
./$(BINARY_SEEDER) -data $(data)
dep:
dep ensure
lint:
@echo "Step: gometalinter"
@gometalinter --vendor --exclude "defer" ./...
@echo "Step: gofmt (simplify)"
@! gofmt -s -l . 2>&1 | grep -v vendor
@echo "Step: goimports"
@! goimports -l . | grep -v vendor