forked from onepanelio/python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (26 loc) · 816 Bytes
/
Makefile
File metadata and controls
32 lines (26 loc) · 816 Bytes
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
.DEFAULT_GOAL := all
init:
ifndef version
err = $(error version is undefined)
$(err)
endif
ifndef path
err = $(error path is undefined)
$(err)
endif
mkdir -p .build
cp $(path) .build/
sdk: init
# generate sdk
docker run --rm -v ${PWD}/.build:/build openapitools/openapi-generator-cli:v4.3.1 \
generate -p packageName=onepanel.core.api,projectName=onepanel-sdk,packageVersion=$(version) -i /build/api.swagger.json -g python -o /build/
rm .build/api.swagger.json
# Update repository files with generated files
cp -r .build/* .
rm -rf onepanel-core-sdk
# Update generated files
sed -i '' 's/git\+https:\/\/github.com\/GIT_USER_ID\/GIT_REPO_ID.git/onepanel-sdk/g' README.md
publish-pip-package:
python3 setup.py sdist
twine upload dist/onepanel-sdk-$(version).tar.gz
all: sdk publish-pip-package