-
Notifications
You must be signed in to change notification settings - Fork 1
/
GNUmakefile
37 lines (26 loc) · 978 Bytes
/
GNUmakefile
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
LOKI_VERSION ?= 2.8.3
default: build
build:
go build -v ./...
install: build
mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
mv ${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
# See https://golangci-lint.run/
lint:
golangci-lint run -c .golangci.toml ./...
generate:
go generate ./...
fmt:
gofmt -s -w -e .
test:
go test -v -cover -timeout 30s -coverprofile=cover.out -parallel=4 ./...
go tool cover -func=cover.out
testacc: compose-up
curl -s --retry 12 -f --retry-all-errors --retry-delay 10 http://localhost:3100/ready
TF_ACC=1 LOKI_URI=http://localhost:3100 go test -cover ./... -v $(TESTARGS) -timeout 120m -coverprofile=cover.out
go tool cover -func=cover.out
compose-up: compose-down
LOKI_VERSION=$(LOKI_VERSION) docker-compose -f ./docker-compose.yml up -d
compose-down:
docker-compose -f ./docker-compose.yml stop
.PHONY: build install lint generate fmt test testacc