Skip to content

Commit d445d44

Browse files
authored
add scripts for auto release (#18)
ENHANCEMENTS: - Add toolkit for auto release (#18)
1 parent 3e9c7e9 commit d445d44

File tree

17 files changed

+216
-2780
lines changed

17 files changed

+216
-2780
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,5 @@ venv.bak/
114114
examples/debug
115115
bdd/
116116
.version
117+
118+
scripts/gen-apis.sh

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ install: pip install -e .[ci]
1515
script:
1616
- make lint
1717
- make test-cov
18+
# - make release-check
1819

1920
after_success:
2021
- bash <(curl -s https://codecov.io/bash)
File renamed without changes.

Makefile

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,14 @@ clean-test:
7878
rm -f .coverage
7979
rm -fr htmlcov/
8080

81-
gen:
82-
ucloud-model sdk apis \
83-
--lang python3 \
84-
--type=public \
85-
--template ${UCLOUD_TEMPLATE_PATH}/scripts-api.tpl \
86-
--output ./scripts/gen-services.sh
87-
ucloud-model sdk tests \
88-
--lang python3 \
89-
--template ${UCLOUD_TEMPLATE_PATH}/scripts-test.tpl \
90-
--output ./scripts/gen-tests.sh
91-
9281
version:
9382
@python -c 'from ucloud.version import version; print(version)'
83+
84+
codegen:
85+
@bash ./scripts/codegen.sh
86+
87+
release-check:
88+
@python scripts/release.py --dry-run
89+
90+
release:
91+
@python scripts/release.py

docs/services.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,3 @@ USMS
7373
.. autoclass:: ucloud.services.usms.client.USMSClient
7474
:members:
7575

76-
VPC
77-
---
78-
79-
.. autoclass:: ucloud.services.vpc.client.VPCClient
80-
:members:

scripts/codegen.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
#set -u
4+
set -e
5+
6+
if [ -n "$PRODUCT" ]; then
7+
ucloud-model sync --lang python --product "$PRODUCT"
8+
ucloud-model sdk apis --type public --product "$PRODUCT" --lang python --template "$U_MODEL_HOME"/providers/python/templates/scripts-api.tpl --output scripts/gen-apis.sh
9+
bash ./scripts/gen-apis.sh
10+
fi
11+
12+
if [ -n "$TEST" ]; then
13+
IFS=',' read -ra TL <<< "$TEST"
14+
for i in "${TL[@]}"; do
15+
ucloud-model sdk test --name "$i" --lang python --template "$U_MODEL_HOME"/providers/python/templates/testing.tpl --output tests/test_services/test_set_"$i".py
16+
done
17+
fi

scripts/gen-services.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

scripts/gen-tests.sh

Lines changed: 0 additions & 253 deletions
This file was deleted.

0 commit comments

Comments
 (0)