|
@@ -1,13 +1,16 @@
|
|
|
{
|
|
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
|
- "id": "service_schema_v1.json",
|
|
|
+ "id": "config_schema_v1.json",
|
|
|
|
|
|
"type": "object",
|
|
|
|
|
|
- "allOf": [
|
|
|
- {"$ref": "#/definitions/service"},
|
|
|
- {"$ref": "#/definitions/constraints"}
|
|
|
- ],
|
|
|
+ "patternProperties": {
|
|
|
+ "^[a-zA-Z0-9._-]+$": {
|
|
|
+ "$ref": "#/definitions/service"
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ "additionalProperties": false,
|
|
|
|
|
|
"definitions": {
|
|
|
"service": {
|
|
@@ -162,21 +165,24 @@
|
|
|
{"type": "array", "items": {"type": "string"}, "uniqueItems": true}
|
|
|
]
|
|
|
},
|
|
|
+
|
|
|
"constraints": {
|
|
|
- "id": "#/definitions/constraints",
|
|
|
- "anyOf": [
|
|
|
- {
|
|
|
- "required": ["build"],
|
|
|
- "not": {"required": ["image"]}
|
|
|
- },
|
|
|
- {
|
|
|
- "required": ["image"],
|
|
|
- "not": {"anyOf": [
|
|
|
- {"required": ["build"]},
|
|
|
- {"required": ["dockerfile"]}
|
|
|
- ]}
|
|
|
- }
|
|
|
- ]
|
|
|
+ "services": {
|
|
|
+ "id": "#/definitions/services/constraints",
|
|
|
+ "anyOf": [
|
|
|
+ {
|
|
|
+ "required": ["build"],
|
|
|
+ "not": {"required": ["image"]}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "required": ["image"],
|
|
|
+ "not": {"anyOf": [
|
|
|
+ {"required": ["build"]},
|
|
|
+ {"required": ["dockerfile"]}
|
|
|
+ ]}
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|