-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (38 loc) · 1.15 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
check-env:
ifndef GOPATH
@echo "Couldn't find the GOPATH env"
@exit 1
endif
check-keys:
ifndef CLAIMR_DATABASE
@echo "Couldn't find the CLAIMR_DATABASE env"
@exit 1
endif
ifndef CLAIMR_TOKEN
@echo "Couldn't find the CLAIMR_TOKEN env"
@exit 1
endif
build: check-env
@go build -o build/claimr main.go
@echo "\nCheck the binary on the build dir build/claimr\n"
@ls -lah build
install: check-env
go install -v github.com/evandroflores/claimr
run: check-env check-keys
@go run main.go
docker-build:
docker build -t evandroflores/claimr .
docker-run: check-keys
@docker run -e "CLAIMR_TOKEN=${CLAIMR_TOKEN} CLAIMR_DATABASE=${CLAIMR_DATABASE}" evandroflores/claimr
test: check-keys
@go test -gcflags=-l -cover ./...
cover: check-keys
@rm -f coverage.*
@echo 'mode: atomic' > coverage.txt
go list ./... | xargs -n1 -I{} sh -c 'touch coverage.out & go test -gcflags=-l -race -covermode=atomic -coverprofile=coverage.out {} && tail -n +2 coverage.out >> coverage.txt'
open-cover:
go tool cover -html coverage.txt
lint:
@gometalinter ./... --config=.gometalinter.json
linter-install:
go get -u github.com/alecthomas/gometalinter; gometalinter --install