-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathMakefile
79 lines (62 loc) · 1.95 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
PKG = github.com/aerogear/mobile-cli
TOP_SRC_DIRS = pkg
TEST_DIRS ?= $(shell sh -c "find $(TOP_SRC_DIRS) -name \\*_test.go \
-exec dirname {} \\; | sort | uniq")
BIN_DIR := $(GOPATH)/bin
SHELL = /bin/bash
LDFLAGS=-ldflags "-w -s -X main.Version=${TAG}"
.PHONY: setup
setup:
@go get github.com/kisielk/errcheck
@go get -d github.com/goreleaser/goreleaser
.PHONY: build
build: setup check build_binary
.PHONY: coveralls_build
coveralls_build: setup coveralls_check build_binary
.PHONY: build_binary_linux
build_binary_linux:
env GOOS=linux GOARCH=amd64 go build -o mobile ./cmd/mobile
.PHONY: build_binary
build_binary:
go build -o mobile ./cmd/mobile
.PHONY: generate
generate:
./scripts/generate.sh
.PHONY: test-unit
test-unit:
@echo Running tests:
go test -v -race -cover $(UNIT_TEST_FLAGS) \
$(addprefix $(PKG)/,$(TEST_DIRS))
.PHONY: coveralls_test-unit
coveralls_test-unit:
@echo Running tests:
go test -v -race -cover -covermode=atomic -coverprofile=coverage.out $(UNIT_TEST_FLAGS) \
$(addprefix $(PKG)/,$(TEST_DIRS))
goveralls -coverprofile=coverage.out -service=jenkins-ci -repotoken $(COVERALLS_TOKEN)
.PHONY: integration
integration: build_binary
go test -v ./integration -args -namespace=`oc project -q` -executable=`pwd`/mobile
.PHONY: errcheck
errcheck:
@echo errcheck
@errcheck -ignoretests $$(go list ./... | grep -v mobile-cli/pkg/client)
.PHONY: vet
vet:
@echo go vet
@go vet $$(go list ./... | grep -v mobile-cli/pkg/client)
.PHONY: fmt
fmt:
@echo go fmt
diff -u <(echo -n) <(gofmt -d `find . -type f -name '*.go' -not -path "./vendor/*"`)
.PHONY: check
check: errcheck vet fmt test-unit
.PHONY: coveralls_check
coveralls_check: errcheck vet fmt coveralls_test-unit
integration_binary:
go test -c -v ./integration
.PHONY: integration
integration: build_binary integration_binary
./integration.test -test.v -namespace=`oc project -q` -executable=`pwd`/mobile
.PHONY: release
release: setup
goreleaser --rm-dist