forked from camptocamp/terraboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (33 loc) · 1.08 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
DEPS = $(wildcard */*.go)
VERSION = $(shell git describe --always)
all: test terraboard
terraboard: main.go $(DEPS)
GO111MODULE=on CGO_ENABLED=1 GOOS=linux go build \
-ldflags "-linkmode external -extldflags -static -X main.version=$(VERSION)" \
-o $@ $<
strip $@
lint:
@ go get -v golang.org/x/lint/golint
@for file in $$(git ls-files '*.go' | grep -v '_workspace/'); do \
export output="$$(golint $${file} | grep -v 'type name will be used as docker.DockerInfo')"; \
[ -n "$${output}" ] && echo "$${output}" && export status=1; \
done; \
exit $${status:-0}
vet: main.go
go vet $<
imports: main.go
go get golang.org/x/tools/cmd/goimports && goimports -d $<
test: lint vet imports
GO111MODULE=on go test -v ./...
vendor:
GO111MODULE=on go mod vendor
coverage:
rm -rf *.out
go test -coverprofile=coverage.out
for i in config util s3 db api compare auth; do \
go test -coverprofile=$$i.coverage.out github.com/camptocamp/terraboard/$$i; \
tail -n +2 $$i.coverage.out >> coverage.out; \
done
clean:
rm -f terraboard
.PHONY: all lint vet imports test coverage clean