Skip to content

ProviderCommand schema

{
    "$schema": "http://json-schema.org/draft/2019-09/schema#",
    "title": "JSON SCHEMA for opentestfactory.org/v1alpha1 ProviderCommand manifests",
    "type": "object",

    "properties": {
        "apiVersion": { "const": "opentestfactory.org/v1alpha1" },
        "kind": { "const": "ProviderCommand" },
        "metadata": {
            "type": "object",
            "properties": {
                "name": { "type": "string" },
                "workflow_id": { "type": "string" },
                "job_id": { "type": "string" },
                "job_origin": { "type": "array", "items": { "type": "string" } },
                "step_id": { "type": "string" },
                "step_origin": { "type": "array", "items": { "type": "string" } },

                "labels": {
                    "type": "object",
                    "patternProperties": {
                        "^([a-zA-Z0-9-.]+/)?[a-zA-Z0-9]([a-zA-Z0-9._-]*[a-zA-Z0-9])?$": {
                            "type": "string"
                        }
                    },
                    "minProperties": 1,
                    "additionalProperties": false
                }
            },
            "additionalProperties": true,
            "required": [
                "name", "workflow_id", "job_id", "job_origin", "step_id", "step_origin"
            ]
        },
        "runs-on": { "$ref": "#/definitions/runs-on" },
        "contexts": { "type": "object" },
        "step": {
            "type": "object",
            "properties": {
                "name": { "type": "string" },
                "id": { "type": "string" },
                "uses": { "type": "string" },
                "with": { "type": "object" },
                "variables": { "$ref": "#/definitions/variables" },
                "timeout-minutes": { "type": "number" },
                "continue-on-error": { "type": "boolean" },
                "working-directory": { "type": "string" }
            },
            "required": [ "uses" ],
            "additionalProperties": false
        }
    },
    "required": [ "apiVersion", "kind", "metadata", "runs-on", "step", "contexts" ],
    "additionalProperties": false,


    "definitions": {
        "runs-on": {
            "anyOf": [
                {
                    "type": "string",
                    "pattern": "^[a-zA-Z][a-zA-Z0-9-]*$"
                },
                {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "pattern": "^[a-zA-Z][a-zA-Z0-9-]*$"
                    },
                    "minItems": 1
                }
            ]
        },
        "variables": {
            "type": "object",
            "patternProperties": {
                "^[a-zA-Z0-9_]+$": { "type": "string" }
            },
            "minProperties": 1
        }
    }
}