docs: 更新文档匹配执行器 steps/params 格式 (#16)
- Workflow-规范.md: 添加 type: python 字段 - TOOLS.md: 添加 type: python 到示例 - 套件发布指南.md: 更新为 upload 端点 + tar.gz 上传方式 + 完整示例 - CLI-参考.md: gis-actions 版本 3.0.2 → 3.0.5
This commit is contained in:
@@ -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` 命令。
|
||||
|
||||
@@ -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 列表,控制执行顺序 |
|
||||
|
||||
+34
-14
@@ -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
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user