-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (50 loc) · 1.49 KB
/
Makefile
File metadata and controls
59 lines (50 loc) · 1.49 KB
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
58
59
CURRENT_SHORT_COMMIT := $(shell git rev-parse --short HEAD)
CURRENT_VERSION := $(shell git describe --tags --abbrev=0 --exact-match 2>/dev/null)
LAST_KNOWN_VERSION := $(shell git describe --tags --abbrev=0 2>/dev/null)
CONTAINER := flow-playground-api
IMAGE_URL := gcr.io/dl-flow/playground-api
K8S_YAMLS_LOCATION := ./k8s
KUBECONFIG := $(shell uuidgen)
.PHONY: generate
generate:
GO111MODULE=on go generate ./...
.PHONY: ci
ci: check-tidy
GO111MODULE=on go test -timeout 30m -v ./...
.PHONY: test-log
test-log:
GO111MODULE=on go test -timeout 30m -v ./... > test-results.log
.PHONY: run
run:
FLOW_DEBUG=true \
FLOW_SESSIONCOOKIESSECURE=false \
GO111MODULE=on \
go run \
-ldflags "-X github.com/onflow/flow-playground-api/build.version=$(LAST_KNOWN_VERSION)" \
server/server.go
.PHONY: run-pg
run-pg:
FLOW_DB_USER=postgres \
FLOW_DB_PASSWORD=password \
FLOW_DB_PORT=5432 \
FLOW_DB_NAME=dapper \
FLOW_DB_HOST=localhost \
FLOW_STORAGEBACKEND=postgresql \
FLOW_DEBUG=true FLOW_SESSIONCOOKIESSECURE=false \
GO111MODULE=on \
go run \
-ldflags "-X github.com/onflow/flow-playground-api/build.version=$(LAST_KNOWN_VERSION)" \
server/server.go
.PHONY: install-linter
install-linter:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${GOPATH}/bin v1.47.2
.PHONY: lint
lint: check-headers
golangci-lint run -v ./...
.PHONY: check-headers
check-headers:
@./check-headers.sh
.PHONY: check-tidy
check-tidy: generate
go mod tidy
git diff --exit-code