forked from sigstore/rekor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (30 loc) · 1.51 KB
/
Makefile
File metadata and controls
44 lines (30 loc) · 1.51 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
.PHONY: all test clean clean-gen lint gosec
all: rekor-cli rekor-server
GENSRC = pkg/generated/client/%.go pkg/generated/models/%.go pkg/generated/restapi/%.go
OPENAPIDEPS = openapi.yaml $(shell find pkg/types -iname "*.json")
SRCS = $(shell find cmd -iname "*.go") $(shell find pkg -iname "*.go"|grep -v pkg/generated) pkg/generated/restapi/configure_rekor_server.go $(GENSRC)
$(GENSRC): $(OPENAPIDEPS)
swagger generate client -f openapi.yaml -q -r COPYRIGHT.txt -t pkg/generated --default-consumes application/json\;q=1
swagger generate server -f openapi.yaml -q -r COPYRIGHT.txt -t pkg/generated --exclude-main -A rekor_server --exclude-spec --flag-strategy=pflag --default-produces application/json
# this exists to override pattern match rule above since this file is in the generated directory but should not be treated as generated code
pkg/generated/restapi/configure_rekor_server.go: $(OPENAPIDEPS)
lint:
$(GOBIN)/golangci-lint run -v ./...
gosec:
$(GOBIN)/gosec ./...
rekor-cli: $(SRCS)
go build ./cmd/rekor-cli
rekor-server: $(SRCS)
go build ./cmd/rekor-server
test:
go test ./...
clean:
rm -rf rekor-cli rekor-server
clean-gen: clean
rm -rf $(shell find pkg/generated -iname "*.go"|grep -v pkg/generated/restapi/configure_rekor_server.go)
up:
docker-compose -f docker-compose.yml build
docker-compose -f docker-compose.yml up
debug:
docker-compose -f docker-compose.yml -f docker-compose.debug.yml build rekor-server-debug
docker-compose -f docker-compose.yml -f docker-compose.debug.yml up rekor-server-debug