This repository has been archived by the owner on Jun 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (46 loc) · 1.38 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
52
53
54
55
56
GOPATH := $(GOPATH)
GIT_HASH := $(shell git describe --tags --always --dirty)
BUILD_TIME := $(shell date -u '+%Y-%m-%d_%I:%M:%S%p')
TESTABLE_PACKAGES := $(shell go list gitlab.com/verygoodsoftwarenotvirus/blanket/... | grep -v -e "example_packages")
.PHONY: binary
binary:
go build -o devBlanket gitlab.com/verygoodsoftwarenotvirus/blanket/cmd/blanket
.PHONY: blankoverage
blankoverage: binary
if [ -f coverage.out ]; then rm coverage.out; fi
go test -coverprofile=coverage.out
blanket cover --html=coverage.out
if [ -f coverage.out ]; then rm coverage.out; fi
.PHONY: introspect
introspect: binary
for pkg in $(TESTABLE_PACKAGES); do \
set -e; \
./devBlanket analyze --fail-on-found --package=$$pkg; \
done
.PHONY: vendor
vendor:
dep ensure -update -v
.PHONY: revendor
revendor:
rm -rf vendor
rm Gopkg.*
dep init -v
.PHONY: tests
tests:
set -ex; go test -v -cover -race $(TESTABLE_PACKAGES)
.PHONY: coverage
coverage:
if [ -f coverage.out ]; then rm coverage.out; fi
echo "mode: set" > coverage.out
for pkg in $(TESTABLE_PACKAGES); do \
set -e; \
go test -coverprofile=profile.out -v -race $$pkg; \
cat profile.out | grep -v "mode: atomic" >> coverage.out; \
done
rm profile.out
.PHONY: ci-coverage
ci-coverage:
go test $(TESTABLE_PACKAGES) -v -coverprofile=profile.out
.PHONY: docker-image
docker-image:
docker build --tag 'blanket:latest' .