Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion template/{{cookiecutter.project_name}}/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.2
1.0.3rc1
3 changes: 3 additions & 0 deletions template/{{cookiecutter.project_name}}/app_desc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ modules:
isDefault: true
language: python
spec:
hooks:
preRelease:
procCommand: "bash bin/sync_apigateway.sh"
configuration:
env:
- name: PYTHONPATH
Expand Down
8 changes: 0 additions & 8 deletions template/{{cookiecutter.project_name}}/bin/post_compile

This file was deleted.

26 changes: 26 additions & 0 deletions template/{{cookiecutter.project_name}}/bin/sync_apigateway.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
# DO NOT MODIFY THIS SECTION !!!
echo "do migrate"
python bin/manage.py migrate --no-input
python bin/manage.py createcachetable
echo "[Sync] BEGIN ====================="

# 使用智能同步命令,仅在接口定义发生变化时才同步到API网关
# 该命令会自动:
# 1. 生成 definition.yaml 和 resources.yaml
# 2. 计算文件哈希值并与上次同步的哈希值对比
# 3. 仅在哈希值变化时执行 sync_drf_apigateway
# 4. 获取 API 网关公钥
#
# 如需强制同步,可添加 --force 参数:
# python bin/manage.py sync_apigateway_if_changed --force

python bin/manage.py sync_apigateway_if_changed
if [ $? -ne 0 ]
then
echo "sync_apigateway_if_changed fail"
exit 1
fi

echo "[Sync] DONE ====================="
# DO NOT MODIFY THIS SECTION !!!
2 changes: 1 addition & 1 deletion template/{{cookiecutter.project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies = [
"aidev-ai-blueking==1.3.2",
"aidev-bkplugin==1.0.13",
"aidev-wxbot>=1.0.9,<1.1",
"bk-plugin-framework>=2.3.3,<2.4.0",
"bk-plugin-framework==2.3.5",
"bkapi-bk-apigateway==1.0.12",
"celery==5.4.0",
"django-celery-beat==2.7.0",
Expand Down
3 changes: 1 addition & 2 deletions template/{{cookiecutter.project_name}}/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ asgiref==3.10.0
attrs==25.4.0
backoff==2.2.1
billiard==4.2.2
bk-plugin-framework==2.3.3
bk-plugin-runtime==2.1.2
bk-plugin-framework==2.3.5
bkapi-bk-apigateway==1.0.12
bkapi-client-core==1.2.0
bkoauth==0.1.0
Expand Down
33 changes: 25 additions & 8 deletions template/{{cookiecutter.project_name}}/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading