为“远程执行脚本”任务准备压缩文件
扩展所有 | 折叠所有
基于 manifest.json 文件的“远程执行脚本”任务的压缩文件必须满足以下要求:
- 压缩文件格式:ZIP。
- 总大小:不超过 1 GB。
- 压缩文件中的文件和文件夹的数量不受限制。
- 压缩文件的清单文件必须与下面的架构匹配,并且必须命名为 manifest.json。仅在设备上执行任务期间验证架构。
清单文件的 JSON 架构和数组的描述
JSON 架构
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title"
: "Schema for execute scripts task",
"type"
: "object",
"properties"
: {
"version"
: {
"type"
: "integer",
"enum"
: [1]
},
"actions"
:{
"type"
: "array",
"items"
: {
"type"
: "object",
"properties"
: {
"type"
: {
"type"
: "string",
"enum"
: ["execute"]
},
"path"
: {
"type"
: "string"
},
"args"
: {
"type"
: "string"
},
"results"
:{
"type"
: "array",
"items"
: {
"type"
: "object",
"properties"
: {
"code"
: {
"type"
: "integer",
"minimum"
: -255,
"maximum"
: 255
},
"next"
:{
"type"
: "string",
"enum"
: ["break", "continue"]
}
},
"required"
: [
"code"
,
"next"
]
}
},
"default_next"
:{
"type"
: "string",
"enum"
: ["break", "continue"]
}
},
"required"
: [
"type"
,
"path"
,
"default_next"
]
}
}
},
"required"
: [
"version"
,
"actions"
]
}
清单文件示例
{
"
version
": 1,
"
actions
": [
{
"
type
": "execute",
"
path
": "scripts/run1.cmd",
"
args
": "testArg",
"
results
": [
{
"
code
": 0,
"
next
": "continue"
}
],
"
default_next
": "break"
},
{
"
type
": "execute",
"
path
": "scripts/run2.cmd",
"
results
": [
{
"
code
": 0,
"
next
": "continue"
}
],
"
default_next
": "break"
},
{
"
type
": "execute",
"
path
": "scripts/run3.cmd",
"
results
": [
{
"
code
": 0,
"
next
": "continue"
}
],
"
default_next
": "break"
}
]
}
- 压缩文件的结构必须如下:
manifest.json
<file1>
<file2>
<folder1>/<file3>
<folder2>/<folder3>/<file4>
...
<fileX>
manifest.json 是该任务的清单文件。
<file1>, ...., <fileX>
是包含待执行脚本的文件集合。
页顶