-
Notifications
You must be signed in to change notification settings - Fork 153
/
Makefile
41 lines (31 loc) · 891 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
39
40
41
VERSION := "0.1"
GIT_COMMIT := $(shell git rev-parse --short HEAD)
GO := go
CGO_ENABLED ?= 0
GO := CGO_ENABLED=$(CGO_ENABLED) GO111MODULE=on GOFLAGS=-mod=readonly go
######################################################
#
# Development targets
#
######################################################
.PHONY: all
all: build check test
LDFLAGS := -X github.com/open-policy-agent/contrib/data_filter_elasticsearch/internal/version.Vcs=$(GIT_COMMIT) \
-X github.com/open-policy-agent/contrib/data_filter_elasticsearch/internal/version.Version=$(VERSION)
.PHONY: build
build:
$(GO) build -ldflags "$(LDFLAGS)" ./cmd/opa-es-filtering/...
.PHONY: check
check: check-fmt check-vet check-lint
.PHONY: check-fmt
check-fmt:
./build/check-fmt.sh
.PHONY: check-vet
check-vet:
./build/check-vet.sh
.PHONY: check-lint
check-lint:
./build/check-lint.sh
.PHONY: test
test:
$(GO) test ./...