diff --git a/suite-developer/TOOLS.md b/suite-developer/TOOLS.md index b31877b..16ae00f 100644 --- a/suite-developer/TOOLS.md +++ b/suite-developer/TOOLS.md @@ -60,6 +60,7 @@ base_image: gis-base:latest steps: - id: step1 name: 步骤名称 + type: python script_id: run params: input: $params.input_path diff --git a/suites-help/SDK参考/CLI-参考.md b/suites-help/SDK参考/CLI-参考.md index fc7546b..b9a187d 100644 --- a/suites-help/SDK参考/CLI-参考.md +++ b/suites-help/SDK参考/CLI-参考.md @@ -5,8 +5,8 @@ `agc` 命令随 gis-actions 包一起安装: ```bash -curl -sLO https://git.mercator.cn/api/packages/AgentGIS/generic/gis-actions/3.0.2/gis-actions_3.0.2_all.deb -sudo dpkg -i gis-actions_3.0.2_all.deb +curl -sLO https://git.mercator.cn/api/packages/AgentGIS/generic/gis-actions/3.0.5/gis-actions_3.0.5_all.deb +sudo dpkg -i gis-actions_3.0.5_all.deb ``` 安装后直接使用 `agc` 命令。 diff --git a/suites-help/开发者指南/Workflow-规范.md b/suites-help/开发者指南/Workflow-规范.md index c588dfd..1a26110 100644 --- a/suites-help/开发者指南/Workflow-规范.md +++ b/suites-help/开发者指南/Workflow-规范.md @@ -32,6 +32,7 @@ env: steps: - id: step1 name: 步骤名称 + type: python script_id: run params: input: $params.input_path @@ -55,6 +56,7 @@ steps: |------|------|------| | `id` | ✅ | 步骤唯一 ID | | `name` | ❌ | 步骤显示名称 | +| `type` | ✅ | 步骤类型,当前固定为 `python` | | `script_id` | ✅ | 脚本 ID(对应 scripts/ 下的 .py 文件名,不含扩展名) | | `params` | ❌ | 步骤参数,值中使用 `$params.xxx` 引用用户输入 | | `depends_on` | ❌ | 依赖的步骤 ID 列表,控制执行顺序 | diff --git a/suites-help/开发者指南/套件发布指南.md b/suites-help/开发者指南/套件发布指南.md index 4991459..a0adb81 100644 --- a/suites-help/开发者指南/套件发布指南.md +++ b/suites-help/开发者指南/套件发布指南.md @@ -8,23 +8,43 @@ ## 通过 API 发布 ```bash -curl -X POST https://suites.mercator.cn/api/v1/publish \ +curl -X POST https://suites.mercator.cn/api/v1/publish/upload \ -H "Authorization: Bearer mk_xxxx" \ - -H "Content-Type: application/json" \ - -d '{ - "name": "my-suite", - "version": "1.0.0", - "description": "我的套件", - "workflow_yaml": "name: my-suite\nversion: 1.0.0\nsteps: ...", - "scripts": {"run.py": "#!/usr/bin/env python3\n..."} - }' + -F "file=@my-suite.tar.gz" ``` -## 发布流程 +其中 `my-suite.tar.gz` 包含: ``` -1. 提交 workflow.yaml + scripts/ 内容 -2. 系统自动校验格式 -3. 校验通过 → 打包上传到 Gitea Packages -4. 在数据库中注册套件记录 +my-suite/ +├── workflow.yaml +└── scripts/ + └── run.py +``` + +`workflow.yaml` 示例: + +```yaml +name: my-suite +description: 我的套件 +version: 1.0.0 +author: 作者 +tags: [gis] +category: general + +params: + input_path: + type: string + required: true + desc: 输入文件路径 + +base_image: gis-base:latest + +steps: + - id: step1 + name: 处理步骤 + type: python + script_id: run + params: + input_path: $params.input_path ```