{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://example.com/ci/schema.json", "title": "ci.Config", "type": "object", "additionalProperties": false, "required": ["version", "on", "do"], "properties": { "version": { "type": "integer", "const": 1 }, "on": { "$ref": "#/$defs/On" }, "do": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/Task" } } }, "anyOf": [ { "properties": { "on": { "type": "object", "required": ["push"], "properties": { "push": { "type": "object", "required": ["bookmarks"], "properties": { "bookmarks": { "type": "array", "minItems": 1 } } } } } } }, { "properties": { "on": { "type": "object", "required": ["remove"], "properties": { "remove": { "type": "object", "required": ["bookmarks"], "properties": { "bookmarks": { "type": "array", "minItems": 1 } } } } } } } ], "$defs": { "On": { "type": "object", "additionalProperties": false, "properties": { "push": { "$ref": "#/$defs/OnPush" }, "remove": { "$ref": "#/$defs/OnRemove" } } }, "OnPush": { "type": "object", "additionalProperties": false, "properties": { "bookmarks": { "type": "array", "items": { "type": "string" } } } }, "OnRemove": { "type": "object", "additionalProperties": false, "properties": { "bookmarks": { "type": "array", "items": { "type": "string" } } } }, "Task": { "type": "object", "additionalProperties": false, "required": ["type"], "properties": { "type": { "type": "string", "enum": ["webhook", "container"] }, "webhook": { "$ref": "#/$defs/WebhookTask" }, "container": { "$ref": "#/$defs/ContainerTask" } }, "oneOf": [ { "properties": { "type": { "const": "webhook" } }, "required": ["webhook"] }, { "properties": { "type": { "const": "container" } }, "required": ["container"] } ] }, "WebhookTask": { "type": "object", "additionalProperties": false, "required": ["url", "method"], "properties": { "url": { "type": "string", "format": "uri-reference", "minLength": 1 }, "method": { "type": "string", "minLength": 1 }, "headers": { "type": "object", "additionalProperties": { "type": "string" } }, "body": { "type": "string" }, "retry_policy": { "$ref": "#/$defs/RetryPolicy", "default": { "max_attempts": 1 } } } }, "ContainerTask": { "type": "object", "additionalProperties": false, "required": ["image"], "properties": { "image": { "type": "string", "minLength": 1 }, "commands": { "type": "array", "items": { "type": "string" } }, "environment": { "type": "object", "additionalProperties": { "type": "string" } }, "working_dir": { "type": "string" }, "services": { "type": "array", "items": { "$ref": "#/$defs/Service" } } } }, "Service": { "type": "object", "additionalProperties": false, "required": ["name", "image"], "properties": { "name": { "type": "string", "minLength": 1 }, "image": { "type": "string", "minLength": 1 }, "environment": { "type": "object", "additionalProperties": { "type": "string" } } } }, "RetryPolicy": { "type": "object", "additionalProperties": false, "required": ["max_attempts"], "properties": { "max_attempts": { "type": "integer", "minimum": 1 } } } } }