forked from RedHatInsights/entitlements-api-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (40 loc) · 1.16 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
gen_files = api/server.gen.go api/types.gen.go
all: generate build
build:
go build -o entitlements-api-go main.go
go build -o ./bundle-sync bundle_sync/main.go
clean:
find . -name "*.gen.go" | xargs rm
go clean -cache
rm entitlements-api-go
$(gen_files): apispec/api.spec.json
go generate ./...
generate: $(gen_files)
image:
podman build -t entitlements-api-go .
debug-run: generate
ENT_DEBUG=1 \
ENT_CA_PATH=$(PWD)/resources/ca.crt \
ENT_KEY=$(PWD)/test_data/test.key \
ENT_CERT=$(PWD)/test_data/test.cert \
go run main.go
run: generate
ENT_CA_PATH=$(PWD)/resources/ca.crt \
ENT_KEY=$(PWD)/test_data/test.key \
ENT_CERT=$(PWD)/test_data/test.cert \
go run main.go
test: generate
ENT_CA_PATH=$(PWD)/resources/ca.crt \
ENT_KEY=$(PWD)/test_data/test.key \
ENT_CERT=$(PWD)/test_data/test.cert \
go test -v ./...
test-all: generate
ENT_CA_PATH=$(PWD)/resources/ca.crt \
ENT_KEY=$(PWD)/test_data/test.key \
ENT_CERT=$(PWD)/test_data/test.cert \
go test --race --coverprofile=coverage.out --covermode=atomic ./...
bench: generate
ENT_CA_PATH=$(PWD)/resources/ca.crt \
ENT_KEY=$(PWD)/test_data/test.key \
ENT_CERT=$(PWD)/test_data/test.cert \
go test -bench=. ./...