{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://github.com/defenseunicorns/maru-runner/src/types/tasks-file", "$ref": "#/$defs/TasksFile", "$defs": { "Action": { "properties": { "description": { "type": "string", "description": "Description of the action to be displayed during package execution instead of the command" }, "cmd": { "type": "string", "description": "The command to run. Must specify either cmd or wait for the action to do anything." }, "wait": { "$ref": "#/$defs/ActionWait", "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action." }, "env": { "items": { "type": "string" }, "type": "array", "description": "Additional environment variables to set for the command" }, "mute": { "type": "boolean", "description": "Hide the output of the command during package deployment (default false)" }, "maxTotalSeconds": { "type": "integer", "description": "Timeout in seconds for the command (default to 0" }, "maxRetries": { "type": "integer", "description": "Retry the command if it fails up to given number of times (default 0)" }, "dir": { "type": "string", "description": "The working directory to run the command in (default is CWD)" }, "shell": { "$ref": "#/$defs/ShellPreference", "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems" }, "setVariables": { "items": { "$ref": "#/$defs/Variable" }, "type": "array", "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package." }, "task": { "type": "string", "description": "The task to run" }, "with": { "additionalProperties": { "type": "string" }, "type": "object", "description": "Input parameters to pass to the task" }, "if": { "type": "string", "description": "Conditional to determine if the action should run" } }, "additionalProperties": false, "type": "object", "patternProperties": { "^x-": {} } }, "ActionWait": { "properties": { "cluster": { "$ref": "#/$defs/ActionWaitCluster", "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified." }, "network": { "$ref": "#/$defs/ActionWaitNetwork", "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified." } }, "additionalProperties": false, "type": "object", "patternProperties": { "^x-": {} } }, "ActionWaitCluster": { "properties": { "kind": { "type": "string", "description": "The kind of resource to wait for", "examples": [ "Pod", "Deployment)" ] }, "name": { "type": "string", "description": "The name of the resource or selector to wait for", "examples": [ "podinfo", "app=podinfo" ] }, "namespace": { "type": "string", "description": "The namespace of the resource to wait for" }, "condition": { "type": "string", "description": "The condition or jsonpath state to wait for; defaults to exist", "examples": [ "Ready", "Available" ] } }, "additionalProperties": false, "type": "object", "required": [ "kind", "name" ], "patternProperties": { "^x-": {} } }, "ActionWaitNetwork": { "properties": { "protocol": { "type": "string", "enum": [ "tcp", "http", "https" ], "description": "The protocol to wait for" }, "address": { "type": "string", "description": "The address to wait for", "examples": [ "localhost:8080", "1.1.1.1" ] }, "code": { "type": "integer", "description": "The HTTP status code to wait for if using http or https", "examples": [ 200, 404 ] } }, "additionalProperties": false, "type": "object", "required": [ "protocol", "address" ], "patternProperties": { "^x-": {} } }, "InputParameter": { "properties": { "description": { "type": "string", "description": "Description of the parameter" }, "deprecatedMessage": { "type": "string", "description": "Message to display when the parameter is deprecated" }, "required": { "type": "boolean", "description": "Whether the parameter is required", "default": true }, "default": { "type": "string", "description": "Default value for the parameter" } }, "additionalProperties": false, "type": "object", "required": [ "description" ], "patternProperties": { "^x-": {} } }, "InteractiveVariable": { "properties": { "name": { "type": "string", "pattern": "^[A-Z0-9_]+$", "description": "The name to be used for the variable" }, "pattern": { "type": "string", "description": "An optional regex pattern that a variable value must match before a package deployment can continue." }, "description": { "type": "string", "description": "A description of the variable to be used when prompting the user a value" }, "default": { "type": "string", "description": "The default value to use for the variable" }, "prompt": { "type": "boolean", "description": "Whether to prompt the user for input for this variable" } }, "additionalProperties": false, "type": "object", "required": [ "name" ], "patternProperties": { "^x-": {} } }, "ShellPreference": { "properties": { "windows": { "type": "string", "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -> New-Item)", "examples": [ "powershell", "cmd", "pwsh", "sh", "bash", "gsh" ] }, "linux": { "type": "string", "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", "examples": [ "sh", "bash", "fish", "zsh", "pwsh" ] }, "darwin": { "type": "string", "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", "examples": [ "sh", "bash", "fish", "zsh", "pwsh" ] } }, "additionalProperties": false, "type": "object", "patternProperties": { "^x-": {} } }, "Task": { "properties": { "name": { "type": "string", "description": "Name of the task" }, "description": { "type": "string", "description": "Description of the task" }, "actions": { "items": { "$ref": "#/$defs/Action" }, "type": "array", "description": "Actions to take when running the task" }, "inputs": { "additionalProperties": { "$ref": "#/$defs/InputParameter" }, "type": "object", "description": "Input parameters for the task" }, "envPath": { "type": "string", "description": "Path to file containing environment variables" } }, "additionalProperties": false, "type": "object", "required": [ "name" ], "patternProperties": { "^x-": {} } }, "TasksFile": { "properties": { "includes": { "items": { "additionalProperties": { "type": "string" }, "type": "object" }, "type": "array", "description": "List of local task files to include" }, "variables": { "items": { "$ref": "#/$defs/InteractiveVariable" }, "type": "array", "description": "Definitions and default values for variables used in run.yaml" }, "tasks": { "items": { "$ref": "#/$defs/Task" }, "type": "array", "description": "The list of tasks that can be run" } }, "additionalProperties": false, "type": "object", "required": [ "tasks" ], "patternProperties": { "^x-": {} } }, "Variable": { "properties": { "name": { "type": "string", "pattern": "^[A-Z0-9_]+$", "description": "The name to be used for the variable" }, "pattern": { "type": "string", "description": "An optional regex pattern that a variable value must match before a package deployment can continue." } }, "additionalProperties": false, "type": "object", "required": [ "name" ], "patternProperties": { "^x-": {} } } } }