1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00
sap-jenkins-library/resources/schemas/metadata.json
Christopher Fenner 68ef5393c7
chore(go): add schema for go metadata files (#1052)
* chore(go): add schema for go metadata files

* chore(go): use k8s container definition in schema

* chore(go): add reusable schema definitions

* chore(go): add further schema definitions

* docs(schema): add description how to use metadata schema
2019-12-17 12:45:53 +01:00

129 lines
4.5 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Step Metadata",
"type": "object",
"required": ["metadata", "spec"],
"additionalProperties": false,
"properties": {
"metadata": {
"$ref": "#definitions/com.sap.piper.metadata"
},
"spec": {
"type": "object",
"additionalProperties": false,
"properties": {
"inputs": {
"type": "object",
"additionalProperties": false,
"properties": {
"secrets": {
"$ref": "#definitions/com.sap.piper.metadata.spec.inputs.secretList"
},
"resources": {
"$ref": "#definitions/com.sap.piper.metadata.spec.inputs.resourceList"
},
"params": {
"$ref": "#definitions/com.sap.piper.metadata.spec.inputs.paramList"
}
}
},
"containers": {
"$ref": "#definitions/com.sap.piper.metadata.spec.containerList"
},
"sidecars": {
"$ref": "#definitions/com.sap.piper.metadata.spec.containerList"
}
}
}
},
"definitions": {
"com.sap.piper.metadata": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": { "type": "string" },
"description": { "type": "string" },
"longDescription": { "type": "string" }
},
"required": ["name", "description", "longDescription"]
},
"com.sap.piper.metadata.spec.inputs.secretList": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": { "type": "string" },
"description": { "type": "string" },
"type": {
"type": "string",
"enum": ["jenkins"]
}
}
}
},
"com.sap.piper.metadata.spec.inputs.resourceList": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": { "type": "string" },
"description": { "type": "string" },
"type": {
"type": "string",
"enum": ["stash"]
}
}
}
},
"com.sap.piper.metadata.spec.inputs.paramList": {
"type": "array",
"items": {
"$ref": "#definitions/com.sap.piper.metadata.spec.inputs.params"
}
},
"com.sap.piper.metadata.spec.inputs.params": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": { "type": "string" },
"type": { "type": "string" },
"description": { "type": "string" },
"mandatory": { "type": "boolean" },
"default": {},
"scope": {
"$ref": "#definitions/com.sap.piper.metadata.spec.inputs.params.scopeList"
},
"aliases": {
"$ref": "#definitions/com.sap.piper.metadata.spec.inputs.params.aliasList"
}
},
"required": ["name", "type", "scope"]
},
"com.sap.piper.metadata.spec.inputs.params.scopeList": {
"type": "array",
"items": {
"type": "string",
"enum": ["GENERAL", "PARAMETERS", "STAGES", "STEPS"]
}
},
"com.sap.piper.metadata.spec.inputs.params.aliasList": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": { "type": "string" }
}
}
},
"com.sap.piper.metadata.spec.containerList": {
"type": "array",
"items": {
"$ref": "https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json#/definitions/io.k8s.api.core.v1.Container"
}
}
}
}