diff options
| author | bozo.kopic <bozo@kopic.xyz> | 2022-03-22 01:31:27 +0100 |
|---|---|---|
| committer | bozo.kopic <bozo@kopic.xyz> | 2022-03-22 01:31:27 +0100 |
| commit | cc4ba3b063f14943579ffbfe416828590f70ae0a (patch) | |
| tree | af2127920fb57603206ca670beb63b5d58650fb8 /schemas_json | |
| parent | c594b1fca854a7b9fb73d854a9830143cd1032fc (diff) | |
WIP major rewrite
Diffstat (limited to 'schemas_json')
| -rw-r--r-- | schemas_json/action.yaml | 15 | ||||
| -rw-r--r-- | schemas_json/logging.yaml | 123 | ||||
| -rw-r--r-- | schemas_json/message.yaml | 131 | ||||
| -rw-r--r-- | schemas_json/project.yaml | 102 | ||||
| -rw-r--r-- | schemas_json/server.yaml | 93 |
5 files changed, 78 insertions, 386 deletions
diff --git a/schemas_json/action.yaml b/schemas_json/action.yaml new file mode 100644 index 0000000..67f6550 --- /dev/null +++ b/schemas_json/action.yaml @@ -0,0 +1,15 @@ +--- +"$schema": "http://json-schema.org/schema#" +id: "hatter://action.yaml#" +type: object +required: + - image + - command +properties: + image: + type: string + description: container image + command: + type: string + description: shell commands +... diff --git a/schemas_json/logging.yaml b/schemas_json/logging.yaml deleted file mode 100644 index 3c2bdfe..0000000 --- a/schemas_json/logging.yaml +++ /dev/null @@ -1,123 +0,0 @@ ---- -"$schema": "http://json-schema.org/schema#" -id: "hatter://logging.yaml#" -title: Logging -description: Logging configuration -type: object -required: - - version -properties: - version: - title: Version - type: integer - default: 1 - formatters: - title: Formatters - type: object - patternProperties: - "(.)+": - title: Formatter - type: object - properties: - format: - title: Format - type: string - default: null - datefmt: - title: Date format - type: string - default: null - filters: - title: Filters - type: object - patternProperties: - "(.)+": - title: Filter - type: object - properties: - name: - title: Logger name - type: string - default: '' - handlers: - title: Handlers - type: object - patternProperties: - "(.)+": - title: Handler - type: object - description: | - Additional properties are passed as keyword arguments to - constructor - required: - - class - properties: - class: - title: Class - type: string - level: - title: Level - type: string - formatter: - title: Formatter - type: string - filters: - title: Filters - type: array - items: - title: Filter id - type: string - loggers: - title: Loggers - type: object - patternProperties: - "(.)+": - title: Logger - type: object - properties: - level: - title: Level - type: string - propagate: - title: Propagate - type: boolean - filters: - title: Filters - type: array - items: - title: Filter id - type: string - handlers: - title: Handlers - type: array - items: - title: Handler id - type: string - root: - title: Root logger - type: object - properties: - level: - title: Level - type: string - filters: - title: Filters - type: array - items: - title: Filter id - type: string - handlers: - title: Handlers - type: array - items: - title: Handler id - type: string - incremental: - title: Incremental configuration - type: boolean - default: false - disable_existing_loggers: - title: Disable existing loggers - type: boolean - default: true -... diff --git a/schemas_json/message.yaml b/schemas_json/message.yaml deleted file mode 100644 index 7f89ed3..0000000 --- a/schemas_json/message.yaml +++ /dev/null @@ -1,131 +0,0 @@ ---- -"$schema": "http://json-schema.org/schema#" -id: "hatter://message.yaml#" -title: Message -description: Backend-frontend communication messages -oneOf: - - "$ref": "hatter://message.yaml#/definitions/client_message" - - "$ref": "hatter://message.yaml#/definitions/server_message" -definitions: - client_message: - title: Client message - description: Message sent by frontend - oneOf: - - title: Set log - type: object - required: - - type - - offset - - limit - properties: - type: - enum: - - set_log - offset: - type: integer - limit: - type: integer - - title: Add job - type: object - required: - - type - - repository - - commit - properties: - type: - enum: - - add_job - repository: - type: string - commit: - type: string - server_message: - title: Server message - description: Message sent by backend - oneOf: - - title: Active job - type: object - required: - - type - - job - properties: - type: - enum: - - active_job - job: - oneOf: - - type: 'null' - - "$ref": "hatter://message.yaml#/definitions/job" - - title: Job queue - type: object - required: - - type - - jobs - properties: - type: - enum: - - job_queue - jobs: - type: array - items: - "$ref": "hatter://message.yaml#/definitions/job" - - title: Log entries - type: object - required: - - type - - entries - properties: - type: - enum: - - log_entries - entries: - type: array - items: - "$ref": "hatter://message.yaml#/definitions/log_entry" - - title: repositories - type: object - required: - - type - - repositories - properties: - type: - enum: - - repositories - repositories: - type: array - items: - type: string - - job: - type: object - required: - - id - - timestamp - - repository - - commit - properties: - id: - type: integer - timestamp: - type: integer - repository: - type: string - commit: - type: string - log_entry: - type: object - required: - - timestamp - - repository - - commit - - message - properties: - timestamp: - type: integer - repository: - type: string - commit: - type: string - message: - type: string -... diff --git a/schemas_json/project.yaml b/schemas_json/project.yaml deleted file mode 100644 index 7a66914..0000000 --- a/schemas_json/project.yaml +++ /dev/null @@ -1,102 +0,0 @@ ---- -"$schema": "http://json-schema.org/schema#" -id: "hatter://project.yaml#" -title: Project -description: Project configuration -type: array -items: - type: object - description: Single execution environment - required: - - vm - - ssh - - script - properties: - vm: - title: VM - description: VM configuration - type: object - required: - - domain - properties: - uri: - title: URI - description: Libvirt URI - type: string - default: "qemu:///system" - domain: - title: Domain - description: | - Domain registered with libvirt used as execution - environment - type: string - snapshot: - title: Snapshot - description: | - Snapshot used as initial execution environment state - type: string - temp_snapshot: - title: Temporary snapshot - description: | - Snapshot used for storing initial domain state - type: string - default: temp_hatter - get_address_retry_count: - title: Get address retry count - description: | - Maximum number of retries for obtaining running VM guest - IP address - type: integer - default: 10 - get_address_delay: - title: Get address delay - description: | - Delay in seconds between successive get address requests - type: number - default: 5 - ssh: - title: SSH - description: VM guest SSH daemon configuration - type: object - required: - - username - - password - properties: - username: - title: Username - description: Username for connecting to VM guest SSH daemon - type: string - password: - title: Password - description: Password for connecting to VM guest SSH daemon - type: string - connect_retry_count: - title: Connect retry count - description: | - Maximum number of connect retries - type: integer - default: 10 - connect_delay: - title: Connect delay - description: | - Delay in seconds between successive connect calls - type: number - default: 5 - connect_timeout: - title: Connect timeout - description: | - Single connect's TCP connect timeout and authenticate - timeout in seconds - type: number - default: 1 - script: - title: Script - description: | - List of shell commands executed inside VM guest - type: array - items: - title: Command - description: | - Single shell command - type: string -... diff --git a/schemas_json/server.yaml b/schemas_json/server.yaml index 4a576b2..c44528a 100644 --- a/schemas_json/server.yaml +++ b/schemas_json/server.yaml @@ -1,37 +1,70 @@ --- "$schema": "http://json-schema.org/schema#" id: "hatter://server.yaml#" -title: Server -description: Server configuration type: object required: - - repositories + - repos properties: - log: - "$ref": "hatter://logging.yaml#" - host: - title: Host - description: Listening host name - type: string - default: "0.0.0.0" - port: - title: TCP port - description: Listening TCP port - type: integer - default: 24000 - db_path: - title: DB path - description: SQLite database path - type: string - default: hatter.db - webhook_path: - title: Webhook path - type: string - default: '/webhook' - repositories: - title: Repositories - description: List of all repository urls - type: array - items: - type: string + env: + type: object + description: | + environment variables avaliable to all repositories + (keys represent variable names) + patternProperties: + ".+": + type: string + description: environment variable value + repos: + type: object + description: git repositories (keys represent repository names) + patternProperties: + ".+": + type: object + required: + - url + properties: + url: + type: string + description: remote repository location + refs: + type: array + description: git references used for commit listing + items: + type: string + default: + - "refs/heads/*" + actions: + type: array + decription: action file paths inside repository + items: + type: string + default: + - ".hatter.yaml" + min_sync_delay: + type: + - number + - "null" + description: | + minimum time delay (in seconds) between + two consecutive remote ref synchronizations + (null disables synchronization limiting) + default: 5 + max_sync_delay: + type: + - number + - "null" + description: | + maximum time delay (in seconds) between + two consecutive remote ref synchronizations + (null disables periodic synchronization) + default: null + env: + type: object + description: | + environment variables avaliable to this repository + (keys represent variable names) + patternProperties: + ".+": + type: string + description: environment variable value ... |
