-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
43 lines (32 loc) · 910 Bytes
/
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
NAME := http-request-catcher
DEL := /bin/rm
ENTRY := cmd/http-request-catcher/main.go
GIT_VERSION := $(shell git describe --tags --abbrev=0)
BUILD_TIME := $(shell date -u +%Y-%m-%dT%H:%M:%S)
GIT_HASH := $(shell git rev-parse --short HEAD)
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
.PHONY: all
all: $(NAME)
$(NAME):
go build -ldflags "-X main.Version=$(GIT_VERSION) -X main.BuildTime=$(BUILD_TIME) -X main.GitHash=$(GIT_HASH) -X main.GitBranch=$(GIT_BRANCH)" -o $(NAME) $(ENTRY)
.PHONY: clean
clean:
$(DEL) $(NAME)
.PHONY: re
re: clean all
.PHONY: run
run:
go run $(ENTRY)
.PHONY: test
test:
golangci-lint run
gocyclo -over 15 $(ENTRY)
.PHONY: release
release:
goreleaser release --snapshot --clean
.PHONY: compose
compose:
docker-compose -f docker/docker-compose.prod.yml up --build
.PHONY: compose-dev
compose-dev:
docker-compose -f docker/docker-compose.dev.yml up --build