-
Notifications
You must be signed in to change notification settings - Fork 56
/
Makefile
50 lines (39 loc) · 948 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
45
46
47
48
49
50
IMAGE_TAG ?= $(shell git rev-parse HEAD)
VERSION ?= $(shell git describe)
.PHONY: all
all: piko
.PHONY: piko
piko:
mkdir -p bin
go build -ldflags="-X github.com/andydunstall/piko/pkg/build.Version=$(VERSION)" -o bin/piko main.go
.PHONY: inline-test
inline-test:
go test ./... -v
.PHONY: system-test
system-test:
go test ./tests/... -tags system -v -count 1
.PHONY: system-test-short
system-test-short:
go test ./tests/... -tags system -v -count 1 -test.short
.PHONY: test
test:
$(MAKE) inline-test
$(MAKE) system-test
.PHONY: fmt
fmt:
go fmt ./...
.PHONY: lint
lint:
go vet ./...
golangci-lint run
.PHONY: import
import:
goimports -w -local github.com/andydunstall/piko .
.PHONY: coverage
coverage:
go test ./... -coverprofile=coverage.out
go tool cover -html=coverage.out
.PHONY: image
image:
docker build --build-arg version=$(VERSION) . -f build/Dockerfile -t piko:$(IMAGE_TAG)
docker tag piko:$(IMAGE_TAG) piko:latest