-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (56 loc) · 1.76 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
58
59
60
61
62
63
64
65
66
67
68
VERSION ?= $(shell date +"%Y%m%d")
OUTPUT_DIR := _output
.PHONY: format
format:
gofmt -w -s .
cd ndc-http-schema && gofmt -w -s .
.PHONY: test
test:
go test -v -race -timeout 3m ./...
cd ndc-http-schema && go test -v -race -timeout 3m ./...
# Install golangci-lint tool to run lint locally
# https://golangci-lint.run/usage/install
.PHONY: lint
lint:
golangci-lint run --fix
cd ndc-http-schema && golangci-lint run --fix
# clean the output directory
.PHONY: clean
clean:
rm -rf "$(OUTPUT_DIR)"
.PHONY: go-tidy
go-tidy:
go mod tidy
cd ndc-http-schema && go mod tidy
.PHONY: build-jsonschema
build-jsonschema:
cd ./ndc-http-schema/jsonschema && go run .
# build the ndc-http-schema for all given platform/arch
.PHONY: build-cli
build-cli:
go build -o _output/ndc-http-schema ./ndc-http-schema
.PHONY: ci-build-cli
ci-build-cli: export CGO_ENABLED=0
ci-build-cli: clean
cd ./ndc-http-schema && \
go get github.com/mitchellh/gox && \
go run github.com/mitchellh/gox -ldflags '-X github.com/hasura/ndc-http/ndc-http-schema/version.BuildVersion=$(VERSION) -s -w -extldflags "-static"' \
-osarch="linux/amd64 darwin/amd64 windows/amd64 darwin/arm64 linux/arm64" \
-output="../$(OUTPUT_DIR)/ndc-http-schema-{{.OS}}-{{.Arch}}" \
.
.PHONY: generate-test-config
generate-test-config:
go run ./ndc-http-schema update -d ./tests/configuration
.PHONY: start-ddn
start-ddn:
HASURA_DDN_PAT=$$(ddn auth print-pat) docker compose --env-file tests/engine/.env up --build -d
.PHONY: stop-ddn
stop-ddn:
docker compose down --remove-orphans
.PHONY: build-supergraph-test
build-supergraph-test:
docker compose up -d --build ndc-http
cd tests/engine && \
ddn connector-link update myapi --add-all-resources --subgraph ./app/subgraph.yaml && \
ddn supergraph build local
make start-ddn