-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (35 loc) · 772 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
44
GOBIN?=go
DOCKERBIN?=docker
VERSION?=$$(git rev-parse --short HEAD)
GOFLAGS?=-ldflags="-w -s -X 'github.com/tcfw/didem/internal/cli.GitVersion=${VERSION}'" -trimpath
BUILD_DST?=./build
BIN?=didem
IMGREPO?=ghcr.io/tcfw/
IMG?=didem
IMGVER?=latest
IMGTAG?=$(IMGREPO)$(IMG):$(IMGVER)
.PHONY: build
build:
@mkdir -p ${BUILD_DST}
${GOBIN} build ${GOFLAGS} -o ${BUILD_DST}/${BIN} ./cmd/
.PHONY: install
install:
${GOBIN} install ${GOFLAGS} ./cmd/
.PHONY: compress
compress:
upx -9 ${BUILD_DST}/*
.PHONY: docker
docker:
$(DOCKERBIN) build -t $(IMGTAG) .
.PHONY: docker-push
docker-push:
$(DOCKERBIN) push $(IMGTAG)
.PHONY: gen-api
gen-api:
@./scripts/genproto.sh
.PHONY: test
test:
go test -v -cover -covermode atomic ./...
.PHONY: race
race:
go test -race ./...