-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile
44 lines (32 loc) · 1.25 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
VERSION := $(shell git describe --always --long --dirty)
all: mocks test build
# Generate client code from swagger in a local dce repo (make openapi DCE_REPO=/path/to/dce)
openapi:
echo "\nMANUAL STEP: Install goswagger cli tool if needed: https://goswagger.io/install.html\n"
swagger flatten --with-expand $(DCE_REPO)/modules/swagger.yaml > $(PWD)/out.yaml
swagger generate client -f $(PWD)/out.yaml --skip-validation -t $(PWD)
rm ./out.yaml
# Generate interfaces for OpenApi clients so they can be mocked.
ifaces:
echo "\nMANUAL STEP: Install interfacer if needed: `go install github.com/rjeczalik/interfaces/cmd/interfacer`\n"
interfacer -for github.com/Optum/dce-cli/client/operations.Client -as APIer -o internal/util/ifaces.go
echo "\nMANUAL STEP: Update the package name of internal/util/ifaces.go to package util\n"
.PHONY: mocks
mocks:
rm -rf mocks/*
mockery -all
lint:
./scripts/lint.sh
test: lint
./scripts/test.sh
cover:
go test -coverprofile=coverage.out -coverpkg="./pkg/...,./internal/...,./cmd/...,./configs/..." ./tests/...
test_functional:
go test -count=1 -v ./tests/functional/
test_unit:
go test -count=1 -v ./tests/unit/
build:
go build -ldflags "-X github.com/Optum/dce-cli/cmd.version=${VERSION}" .
.PHONY: docs
docs:
./update_docs