f3cd56b78e
Use ~/.pouch, the pouch CLI, and .pouch.yaml as the SSOT container. Keep the inner skills/ packages, and store ACK project state in .pouch/ack instead of docs/ack.
245 lines
7.1 KiB
JSON
245 lines
7.1 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"$id": "https://git.yumee.top/laily/pouch/skills/ack/templates/delivery.schema.json",
|
|
"title": "ACK project delivery contract",
|
|
"description": ".pouch/ack/delivery.yaml 的权威结构;语义规则由 scripts/validate_delivery.py 补充。",
|
|
"type": "object",
|
|
"required": [
|
|
"version",
|
|
"project",
|
|
"enabled",
|
|
"defaultProfile",
|
|
"entrypoints",
|
|
"artifacts",
|
|
"destinations",
|
|
"environments",
|
|
"profiles"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"version": { "type": "integer", "const": 1 },
|
|
"updatedAt": { "type": "string" },
|
|
"project": {
|
|
"type": "object",
|
|
"required": ["name"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"name": { "type": "string", "minLength": 1, "pattern": "\\S" }
|
|
}
|
|
},
|
|
"enabled": { "type": "boolean" },
|
|
"defaultProfile": {
|
|
"type": ["string", "null"],
|
|
"pattern": "^[a-z][a-z0-9-]{0,63}$"
|
|
},
|
|
"intents": { "$ref": "#/definitions/intents" },
|
|
"entrypoints": {
|
|
"type": "object",
|
|
"propertyNames": { "$ref": "#/definitions/id" },
|
|
"additionalProperties": { "$ref": "#/definitions/entrypoint" }
|
|
},
|
|
"artifacts": {
|
|
"type": "object",
|
|
"propertyNames": { "$ref": "#/definitions/id" },
|
|
"additionalProperties": { "$ref": "#/definitions/artifact" }
|
|
},
|
|
"destinations": {
|
|
"type": "object",
|
|
"propertyNames": { "$ref": "#/definitions/id" },
|
|
"additionalProperties": { "$ref": "#/definitions/destination" }
|
|
},
|
|
"environments": {
|
|
"type": "object",
|
|
"propertyNames": { "$ref": "#/definitions/id" },
|
|
"additionalProperties": { "$ref": "#/definitions/environment" }
|
|
},
|
|
"profiles": {
|
|
"type": "object",
|
|
"propertyNames": { "$ref": "#/definitions/id" },
|
|
"additionalProperties": { "$ref": "#/definitions/profile" }
|
|
}
|
|
},
|
|
"definitions": {
|
|
"id": {
|
|
"type": "string",
|
|
"pattern": "^[a-z][a-z0-9-]{0,63}$"
|
|
},
|
|
"intents": {
|
|
"type": "object",
|
|
"required": ["testEnvironment", "release"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"testEnvironment": {
|
|
"type": ["string", "null"],
|
|
"pattern": "^[a-z][a-z0-9-]{0,63}$"
|
|
},
|
|
"release": {
|
|
"type": ["string", "null"],
|
|
"pattern": "^[a-z][a-z0-9-]{0,63}$"
|
|
}
|
|
}
|
|
},
|
|
"relativePath": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))[A-Za-z0-9._/*?+-]+$"
|
|
},
|
|
"stringList": {
|
|
"type": "array",
|
|
"items": { "type": "string" }
|
|
},
|
|
"secretName": {
|
|
"type": "string",
|
|
"pattern": "^[A-Z][A-Z0-9_]{0,127}$"
|
|
},
|
|
"entrypoint": {
|
|
"type": "object",
|
|
"required": [
|
|
"kind",
|
|
"args",
|
|
"requiredSecrets",
|
|
"workingDirectory",
|
|
"timeoutSeconds"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"kind": {
|
|
"type": "string",
|
|
"enum": ["make", "just", "task", "dagger", "script"]
|
|
},
|
|
"target": { "type": "string", "minLength": 1 },
|
|
"function": { "type": "string", "minLength": 1 },
|
|
"path": { "$ref": "#/definitions/relativePath" },
|
|
"args": { "$ref": "#/definitions/stringList" },
|
|
"requiredSecrets": {
|
|
"type": "array",
|
|
"uniqueItems": true,
|
|
"items": { "$ref": "#/definitions/secretName" }
|
|
},
|
|
"workingDirectory": { "$ref": "#/definitions/relativePath" },
|
|
"timeoutSeconds": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 86400
|
|
}
|
|
}
|
|
},
|
|
"artifact": {
|
|
"type": "object",
|
|
"required": ["type", "build"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"type": { "type": "string", "enum": ["deb", "oci-image", "file"] },
|
|
"build": { "$ref": "#/definitions/id" },
|
|
"outputs": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"uniqueItems": true,
|
|
"items": { "$ref": "#/definitions/relativePath" }
|
|
},
|
|
"image": { "type": "string", "minLength": 1 },
|
|
"platforms": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"uniqueItems": true,
|
|
"items": { "type": "string", "pattern": "^[a-z0-9]+/[A-Za-z0-9._-]+$" }
|
|
}
|
|
}
|
|
},
|
|
"destination": {
|
|
"type": "object",
|
|
"required": ["type", "channel"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": ["apt-repository", "oci-registry", "ci-artifact"]
|
|
},
|
|
"channel": {
|
|
"type": "string",
|
|
"enum": ["preview", "staging", "stable"]
|
|
},
|
|
"registry": { "type": "string", "minLength": 1 },
|
|
"repository": { "type": "string", "minLength": 1 },
|
|
"endpoint": { "type": "string", "minLength": 1 },
|
|
"artifactName": { "type": "string", "minLength": 1 },
|
|
"upload": { "$ref": "#/definitions/id" }
|
|
}
|
|
},
|
|
"environment": {
|
|
"type": "object",
|
|
"required": [
|
|
"type",
|
|
"classification",
|
|
"target",
|
|
"deploy",
|
|
"healthCheck",
|
|
"mutex"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"enum": ["ssh-host", "docker-compose", "kubernetes", "custom"]
|
|
},
|
|
"classification": {
|
|
"type": "string",
|
|
"enum": ["development", "staging", "production"]
|
|
},
|
|
"target": { "type": "string", "minLength": 1 },
|
|
"deploy": { "$ref": "#/definitions/id" },
|
|
"healthCheck": { "$ref": "#/definitions/id" },
|
|
"rollback": { "$ref": "#/definitions/id" },
|
|
"mutex": { "type": "string", "minLength": 1 }
|
|
}
|
|
},
|
|
"step": {
|
|
"type": "object",
|
|
"required": ["id", "action"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"id": { "$ref": "#/definitions/id" },
|
|
"action": {
|
|
"type": "string",
|
|
"enum": [
|
|
"verify",
|
|
"pull-request",
|
|
"build",
|
|
"publish",
|
|
"deploy",
|
|
"health-check",
|
|
"approval",
|
|
"mark-ready"
|
|
]
|
|
},
|
|
"entrypoint": { "$ref": "#/definitions/id" },
|
|
"artifact": { "$ref": "#/definitions/id" },
|
|
"destination": { "$ref": "#/definitions/id" },
|
|
"environment": { "$ref": "#/definitions/id" },
|
|
"gate": { "type": "string", "enum": ["release", "production"] },
|
|
"draft": { "type": "boolean" },
|
|
"remote": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$"
|
|
},
|
|
"baseBranch": { "type": "string", "minLength": 1, "maxLength": 255 }
|
|
}
|
|
},
|
|
"profile": {
|
|
"type": "object",
|
|
"required": ["stopAt", "steps"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"stopAt": {
|
|
"type": "string",
|
|
"enum": ["verified", "validation_ready", "review_ready", "released"]
|
|
},
|
|
"steps": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/definitions/step" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|