-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (49 loc) · 1.19 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
57
58
59
60
61
# Makefile adapted from the awesome one found @ apex/up :)
GO ?= go
vendor:
@dep ensure
.PHONY: vendor
# Build all files.
build:
@echo "==> Building"
@$(GO) build ./...
.PHONY: build
# Clean all files.
clean:
@echo "==> Clean"
@-rm ./tldrfeed
.PHONY: clean
# Install from source.
install:
@echo "==> Installing tldrfeed ${GOPATH}/bin/tldrfeed"
@$(GO) install ./...
.PHONY: install
testsetup:
-@docker rm -f tldrfeed-test &> /dev/null
@docker run -d --name tldrfeed-test -p 17017:27017 mvertes/alpine-mongo > /dev/null
export TLDRFEED_TEST_DB="0.0.0.0:17017"
export TLDRFEED_TEST_DB_ENABLED=1
.PHONY: testclean
# Run all tests.
test: testsetup
@$(GO) test ./... && echo "\n==>\033[32m Ok\033[m\n"
.PHONY: test
lint:
@gometalinter --vendor --exclude ineffassign --exclude errcheck --exclude megacheck ./...
.PHONY: lint
docker:
@env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GO) build -a -installsuffix cgo ./cmd/tldrfeed
@docker build -t tldrfeed .
.PHONY: docker
# Show source statistics.
cloc:
@cloc -exclude-dir=vendor .
.PHONY: cloc
# Show to-do items per file.
todo:
@rg TODO:
.PHONY: todo
tools:
brew install dep
@$(GO) get -u gopkg.in/alecthomas/gometalinter.v2
@gometalinter --install