forked from IzakMarais/reporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (43 loc) · 1.24 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
# Running on Windows
#
# Set GOPATH in terminal. Example (make for windows needs forwardslashes):
# set GOPATH=T:/repos/reporter
TARGET:=$(GOPATH)/bin/grafana-reporter
ifeq ($(OS),Windows_NT)
TARGET:=$(GOPATH)/bin/grafana-reporter.exe
endif
SRC:=$(GOPATH)/src/github.com/IzakMarais/reporter
.PHONY: buildall
buildall: build buildlinux
.PHONY: build
build:
go install -v github.com/IzakMarais/reporter/cmd/grafana-reporter
.PHONY: buildlinux
buildlinux:
cmd //v //c "set GOOS=linux&&go install -v github.com/IzakMarais/reporter/cmd/grafana-reporter"
.PHONY: clean
clean:
rm -rf $(GOPATH)/bin
.PHONY: docker-build
docker-build:
@docker build -t izakmarais/grafana-reporter:2.3.0 -t izakmarais/grafana-reporter:latest .
docker-push:
@docker push izakmarais/grafana-reporter
.PHONY: test
test: $(TARGET)
@go test -v ./...
.PHONY test2:
@echo hello $(TARGET)
$(GOPATH)/bin/dep:
@go get -u github.com/golang/dep/cmd/dep
update-deps: $(GOPATH)/bin/dep
@cd $(SRC) && dep ensure
@cd $(SRC)/cmd/grafana-reporter && go install
$(TARGET):
@cd $(SRC)/cmd/grafana-reporter && go install
.PHONY: compose-up
compose-up:
@docker-compose -f ./util/docker-compose.yml up
.PHONY: compose-down
compose-down:
@docker-compose -f ./util/docker-compose.yml stop