-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
58 lines (42 loc) · 1.34 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
SHELL=bash
BUILD=build
BIN_DIR?=.
BUILD_TIME=$(shell date +%s)
GIT_COMMIT=$(shell git rev-parse HEAD)
VERSION ?= $(shell git tag --points-at HEAD | grep ^v | head -n 1)
LDFLAGS=-ldflags "-X main.BuildTime=$(BUILD_TIME) -X main.GitCommit=$(GIT_COMMIT) -X main.Version=$(VERSION)"
export GRAPH_DRIVER_TYPE?=neo4j
export GRAPH_ADDR?=bolt://localhost:7687
export ENABLE_PRIVATE_ENDPOINTS?=true
.PHONY: all
all: audit test build
.PHONY: audit
audit:
go list -m all | nancy sleuth
.PHONY: build
build:
@mkdir -p $(BUILD)/$(BIN_DIR)
go build $(LDFLAGS) -o $(BUILD)/$(BIN_DIR)/dp-dataset-api main.go
.PHONY: debug
debug:
HUMAN_LOG=1 go run -race $(LDFLAGS) main.go
.PHONY: acceptance-publishing
acceptance-publishing: build
ENABLE_PRIVATE_ENDPOINTS=true MONGODB_DATABASE=test HUMAN_LOG=1 go run -race $(LDFLAGS) main.go
.PHONY: acceptance-web
acceptance-web: build
ENABLE_PRIVATE_ENDPOINTS=false MONGODB_DATABASE=test HUMAN_LOG=1 go run -race $(LDFLAGS) main.go
.PHONY: lint
lint:
go install github.com/golangci/golangci-lint/cmd/[email protected]
golangci-lint run ./...
.PHONY: test
test:
go test -race -cover ./...
.PHONY: test-component
test-component:
ENABLE_PRIVATE_ENDPOINTS=true cd features/compose; docker-compose up --abort-on-container-exit
.PHONY: nomis
nomis:
go run NOMIS/nomis.go -mongo-url=localhost:27017
.PHONY: test build debug