forked from grafana/grizzly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (29 loc) · 940 Bytes
/
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
.PHONY: lint test static install uninstall cross
VERSION := $(shell git describe --tags --dirty --always)
BIN_DIR := $(GOPATH)/bin
GOX := $(BIN_DIR)/gox
lint:
test -z $$(gofmt -s -l cmd/ pkg/)
go vet ./...
test:
go test ./...
# Compilation
dev:
go build -ldflags "-X main.Version=dev-${VERSION}" ./cmd/grr
LDFLAGS := '-s -w -extldflags "-static" -X main.Version=${VERSION}'
static:
CGO_ENABLED=0 GOOS=linux go build -ldflags=${LDFLAGS} ./cmd/grr
install:
CGO_ENABLED=0 go install -ldflags=${LDFLAGS} ./cmd/grr
uninstall:
go clean -i ./cmd/grr
$(GOX):
go get -u github.com/mitchellh/gox
cross: $(GOX)
CGO_ENABLED=0 gox -output="dist/{{.Dir}}-{{.OS}}-{{.Arch}}" -ldflags=${LDFLAGS} -arch="amd64 arm64 arm" -os="linux" -osarch="darwin/amd64" ./cmd/grr
# Docker container
container: static
docker build -t grafana/grizzly .
# CI
drone:
drone jsonnet --source .drone/drone.jsonnet --target .drone/drone.yml --stream --format