-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (30 loc) · 1.05 KB
/
Makefile
File metadata and controls
36 lines (30 loc) · 1.05 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
.DEFAULT_GOAL := all
init:
ifndef version
err = $(error version is undefined)
$(err)
endif
ifndef path
err = $(error path is undefined)
$(err)
endif
rm -rf .build
mkdir -p .build
cp $(path) .build/
sdk: init
# generate sdk
docker run --rm -v ${PWD}/.build:/build -v ${PWD}/openapi/templates:/onepanel openapitools/openapi-generator-cli:v4.3.1 \
generate -p packageName=onepanel.core.api,projectName=onepanel-sdk,packageVersion=$(version) -t onepanel -i /build/api.swagger.json -g python -o /build/
rm .build/api.swagger.json
rm -rf ./docs ./onepanel/core/api ./onepanel/core/api/__init__.py .onepanel/__init__.py ./test setup.py setup.cfg test-requirements.txt tox.ini
# Update repository files with generated files
mkdir -p ./onepanel/core/api
cp -r .build/onepanel/core/api/* ./onepanel/core/api
cp -r .build/onepanel/core/__init__.py ./onepanel/core/__init__.py
rm -rf .build/onepanel
cp -r .build/* .
rm -rf onepanel-core-sdk
publish-pip-package:
python3 setup.py sdist
twine upload dist/onepanel-sdk-$(version).tar.gz
all: sdk publish-pip-package