This extends the possible ways of passing references to inputs. The
current ways possible are:
1) "plain references", an array of strings:
["ref1", "ref2", ...]
2) "object references", a mapping of keys to objects:
{"ref1": { <options> }, "ref2": { <options> }, ...}
This patch adds a new way:
3) "array of object references":
[{"id": "ref1", "options": { ... }}, {"id": ... }, ]
While osbuild promises to preserves the order for "object references"
not all JSON serialization libraries preserve the order since the
JSON specification does leave this up to the implementation.
The new "array of object references" thus allows for specifying the
references together with reference specific options and this in a
specific order.
Additionally this paves the way for specifying the same input twice,
e.g. in the case of the `org.osbuild.files` input where a pipeline
could then be specified twice with different files. This needs core
rework though, since internally we use dictionaries right now.
183 lines
4.7 KiB
JSON
183 lines
4.7 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
"$id": "https://osbuild.org/schemas/osbuild2.json",
|
|
|
|
"title": "OSBuild Manifest",
|
|
"description": "OSBuild manifest describing a pipeline and all parameters",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"pipelines": { "$ref": "#/definitions/pipelines" },
|
|
"sources": { "$ref": "#/definitions/sources" },
|
|
"version": {
|
|
"enum": ["2"]
|
|
}
|
|
},
|
|
|
|
"definitions": {
|
|
|
|
"devices": {
|
|
"title": "Collection of devices for a stage",
|
|
"additionalProperties": {
|
|
"$ref": "#/definitions/device"
|
|
}
|
|
},
|
|
|
|
"device": {
|
|
"title": "Device for a stage",
|
|
"additionalProperties": false,
|
|
"required": ["type"],
|
|
"properties": {
|
|
"type": { "type": "string" },
|
|
"parent": { "type": "string" },
|
|
"options": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
},
|
|
|
|
"inputs": {
|
|
"title": "Collection of inputs for a stage",
|
|
"additionalProperties": false,
|
|
"patternProperties": {
|
|
"^[a-zA-Z][a-zA-Z0-9_\\-\\.]{0,254}": {
|
|
"$ref": "#/definitions/input"
|
|
}
|
|
}
|
|
},
|
|
|
|
"input": {
|
|
"title": "Single input for a stage",
|
|
"additionalProperties": false,
|
|
"required": ["type", "origin", "references"],
|
|
"properties": {
|
|
"type": { "type": "string" },
|
|
"origin": { "enum": ["org.osbuild.source", "org.osbuild.pipeline"] },
|
|
"references": { "$ref": "#/definitions/reference" },
|
|
"options": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
},
|
|
|
|
"mounts": {
|
|
"title": "Collection of mount points for a stage",
|
|
"type": "array",
|
|
"items": { "$ref": "#/definitions/mount"}
|
|
},
|
|
|
|
"mount": {
|
|
"title": "Mount point for a stage",
|
|
"additionalProperties": false,
|
|
"required": ["name", "type"],
|
|
"properties": {
|
|
"name": { "type": "string" },
|
|
"type": { "type": "string" },
|
|
"source": {
|
|
"type": "string"
|
|
},
|
|
"target": {
|
|
"type": "string"
|
|
},
|
|
"options": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
},
|
|
|
|
"pipelines": {
|
|
"title": "Collection of pipelines to execute",
|
|
"description": "Array of pipelines to execute one after another",
|
|
"type": "array",
|
|
"items": { "$ref": "#/definitions/pipeline" }
|
|
},
|
|
|
|
"pipeline": {
|
|
"title": "Pipeline Description",
|
|
"description": "Full description of a pipeline to execute",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"name": { "type:": "string" },
|
|
"build": { "type": "string" },
|
|
"runner": { "type": "string" },
|
|
"source-epoch": { "type": "integer" },
|
|
"stages": { "$ref": "#/definitions/stages" }
|
|
}
|
|
},
|
|
|
|
"reference": {
|
|
"oneOf":[
|
|
{
|
|
"type": "array",
|
|
"items": { "type": "string" }
|
|
}, {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}, {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["id"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"id": { "type": "string" },
|
|
"options": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
|
|
"source": {
|
|
"title": "External Source",
|
|
"description": "External source to be passed to the pipeline",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"items": { "$ref": "#/definitions/reference" },
|
|
"options": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"required": ["items"]
|
|
},
|
|
|
|
"sources": {
|
|
"title": "Collection of External Sources",
|
|
"description": "Collection of external sources to be passed to the pipeline",
|
|
"type": "object",
|
|
"additionalProperties": { "$ref": "#/definitions/source" }
|
|
},
|
|
|
|
"stage": {
|
|
"title": "Pipeline Stage",
|
|
"description": "Single stage of a pipeline executing one step",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"type": { "type": "string" },
|
|
"devices": { "$ref": "#/definitions/devices" },
|
|
"inputs": {"$ref": "#/definitions/inputs" },
|
|
"mounts": {"$ref": "#/definitions/mounts" },
|
|
"options": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"required": [ "type" ]
|
|
},
|
|
|
|
"stages": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/definitions/stage" }
|
|
}
|
|
}
|
|
}
|