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:
@@ -60,6 +60,7 @@ base_image: gis-base:latest
|
|||||||
steps:
|
steps:
|
||||||
- id: step1
|
- id: step1
|
||||||
name: 步骤名称
|
name: 步骤名称
|
||||||
|
type: python
|
||||||
script_id: run
|
script_id: run
|
||||||
params:
|
params:
|
||||||
input: $params.input_path
|
input: $params.input_path
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
`agc` 命令随 gis-actions 包一起安装:
|
`agc` 命令随 gis-actions 包一起安装:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -sLO https://git.mercator.cn/api/packages/AgentGIS/generic/gis-actions/3.0.2/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.2_all.deb
|
sudo dpkg -i gis-actions_3.0.5_all.deb
|
||||||
```
|
```
|
||||||
|
|
||||||
安装后直接使用 `agc` 命令。
|
安装后直接使用 `agc` 命令。
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ env:
|
|||||||
steps:
|
steps:
|
||||||
- id: step1
|
- id: step1
|
||||||
name: 步骤名称
|
name: 步骤名称
|
||||||
|
type: python
|
||||||
script_id: run
|
script_id: run
|
||||||
params:
|
params:
|
||||||
input: $params.input_path
|
input: $params.input_path
|
||||||
@@ -55,6 +56,7 @@ steps:
|
|||||||
|------|------|------|
|
|------|------|------|
|
||||||
| `id` | ✅ | 步骤唯一 ID |
|
| `id` | ✅ | 步骤唯一 ID |
|
||||||
| `name` | ❌ | 步骤显示名称 |
|
| `name` | ❌ | 步骤显示名称 |
|
||||||
|
| `type` | ✅ | 步骤类型,当前固定为 `python` |
|
||||||
| `script_id` | ✅ | 脚本 ID(对应 scripts/ 下的 .py 文件名,不含扩展名) |
|
| `script_id` | ✅ | 脚本 ID(对应 scripts/ 下的 .py 文件名,不含扩展名) |
|
||||||
| `params` | ❌ | 步骤参数,值中使用 `$params.xxx` 引用用户输入 |
|
| `params` | ❌ | 步骤参数,值中使用 `$params.xxx` 引用用户输入 |
|
||||||
| `depends_on` | ❌ | 依赖的步骤 ID 列表,控制执行顺序 |
|
| `depends_on` | ❌ | 依赖的步骤 ID 列表,控制执行顺序 |
|
||||||
|
|||||||
+34
-14
@@ -8,23 +8,43 @@
|
|||||||
## 通过 API 发布
|
## 通过 API 发布
|
||||||
|
|
||||||
```bash
|
```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 "Authorization: Bearer mk_xxxx" \
|
||||||
-H "Content-Type: application/json" \
|
-F "file=@my-suite.tar.gz"
|
||||||
-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..."}
|
|
||||||
}'
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 发布流程
|
其中 `my-suite.tar.gz` 包含:
|
||||||
|
|
||||||
```
|
```
|
||||||
1. 提交 workflow.yaml + scripts/ 内容
|
my-suite/
|
||||||
2. 系统自动校验格式
|
├── workflow.yaml
|
||||||
3. 校验通过 → 打包上传到 Gitea Packages
|
└── scripts/
|
||||||
4. 在数据库中注册套件记录
|
└── 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