-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
33 lines (27 loc) · 980 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
.PHONY: lint test static install uninstall cross
VERSION := $(shell git describe --tags --dirty --always)
BIN_DIR := $(GOPATH)/bin
lint:
test -z $$(gofmt -s -l .)
go vet ./...
test:
go test -v ./...
# Compilation
LDFLAGS := '-s -w -extldflags "-static"'
static:
CGO_ENABLED=0 go build -ldflags=${LDFLAGS} ./cmd/cuetsy
install:
CGO_ENABLED=0 go install -ldflags=${LDFLAGS} ./cmd/cuetsy
uninstall:
go clean -i ./cmd/cuetsy
# CI
# Export environment variables from here: https://drone.grafana.net/account
# Only Grafana employees can regenerate the CI configuration
# A temp file is created to make sure the `sign` command succeeds
# For more info: https://github.com/grafana/deployment_tools/blob/master/docs/infrastructure/drone/signing.md
drone:
cue export ./.drone/drone.cue > .drone/drone.tmp.yml
drone fmt --save .drone/drone.tmp.yml
drone lint .drone/drone.tmp.yml
drone sign --save grafana/cuetsy .drone/drone.tmp.yml
mv .drone/drone.tmp.yml .drone/drone.yml