-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
55 lines (38 loc) · 1.31 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
.PHONY: all run.docker run.local deps clean test coverage build.docker build.local build.linux.armv8 build.linux.armv7 build.linux build.osx build.windows
ifneq ("$(wildcard .env)","")
ENV_FILE = .env
else
ENV_FILE = .env.example
endif
GOPKGS = $(shell go list ./... | grep -v /vendor/)
BIN_OUTPUT = bin/buildbot-dashboard
all: build.local test
default: build.local
run.docker: build.docker
docker run -p 127.0.0.1:8000:8000/tcp --env-file=${ENV_FILE} ghophp/buildbot-dashboard
run.local: deps
go run $(GOPKGS) main.go
deps:
go mod vendor
build.docker:
docker build -t="ghophp/buildbot-dashboard" .
build.local:
GO111MODULE=on go build -o $(BIN_OUTPUT) .
build.linux.armv8:
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 GO111MODULE=on go build -o $(BIN_OUTPUT) .
build.linux.armv7:
GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=0 GO111MODULE=on go build -o $(BIN_OUTPUT) .
build.linux:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on go build -o $(BIN_OUTPUT) .
build.osx:
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on go build -o $(BIN_OUTPUT) .
build.windows:
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on go build -o $(BIN_OUTPUT) .
test:
go test -v $(GOPKGS)
coverage:
GO111MODULE=off go get -u github.com/mattn/goveralls
./script/coverage.sh --coveralls
clean:
rm -rf bin
rm -rf vendor