forked from harrybrwn/apizza
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (36 loc) · 1 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
39
40
41
42
43
44
45
46
47
48
49
50
51
COVER=go tool cover
#VERSION=$(shell git describe --tags --abbrev=12)
VERSION=$(shell git describe --tags --abbrev=0)-$(shell git rev-parse --short HEAD)
GOFLAGS=-ldflags "-X $(shell go list)/cmd.version=$(VERSION)"
build: gen
go build $(GOFLAGS)
install: gen
go install $(GOFLAGS)
uninstall: clean
go clean -i
test: test-build
bash scripts/test.sh
bash scripts/integration.sh ./bin/test-apizza
@[ -d ./bin ] && [ -x ./bin/test-apizza ] && rm -rf ./bin
docker:
docker build --rm -t apizza .
docker-test:
docker build -f Dockerfile.test --rm -t apizza:$(VERSION) .
docker run --rm -it apizza:$(VERSION)
release: gen
scripts/release build
test-build: gen
scripts/build.sh test
coverage.txt:
@ echo '' > coverage.txt
go test -v ./... -coverprofile=coverage.txt -covermode=atomic
html: coverage.txt
$(COVER) -html=$<
gen:
go generate ./...
clean:
$(RM) -r coverage.txt release/apizza-* bin dist
go clean -testcache
go clean
all: test build release
.PHONY: install test clean html release gen docker