-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (28 loc) · 1.42 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
FRONTIER_COMMIT := 553c3384828abfc7fa68d67fd04ac0b14520cb0a
.PHONY: clean gen-client gen-spec install-openapi-generator
gen-client: clean gen-spec ## Generate the client using openapi-generator
@openapi-generator generate -g python -o "." \
-i "./etc/openapi.json" -c ./etc/openapi.conf.yaml \
--git-user-id raystack \
--git-repo-id "frontier-python" \
--git-host github.com
@rm -f .gitlab-ci.yml .travis.yml
@echo " > client generated"
clean:
@cat .openapi-generator/FILES | grep -v etc | grep -v .openapi-generator-ignore | \
grep -v api_example.py | grep -v Makefile | grep -v README.md | grep -v example | \
grep -v pyproject.toml | \
xargs rm -rf
@rm -rf test __pycache__ docs frontier_api
@echo " > autogenerated files deleted"
gen-spec: ## Generate the openapi v3 spec using raystack/frontier generated v2 spec
@echo " > generating openapiv3 spec"
@curl -X 'GET' \
'https://converter.swagger.io/api/convert?url=https%3A%2F%2Fraw.githubusercontent.com%2Fraystack%2Ffrontier%2F${FRONTIER_COMMIT}%2Fproto%2Fapidocs.swagger.yaml' \
-H 'accept: application/json' > ./etc/openapi.json
## v7.0.1
install-openapi-generator: ## Install openapi-generator
@echo " > installing openapi-generator"
@curl https://raw.githubusercontent.com/Homebrew/homebrew-core/73338e79c4dffa794560535b642a2e0eccd78a9b/Formula/o/openapi-generator.rb > ./openapi-generator.rb
@brew install ./openapi-generator.rb
@rm ./openapi-generator.rb