{ "title": "Tugboat QA Configuration", "description": "Schema for Tugboat QA config.yml", "$id": "https://docs.tugboatqa.com/config-schema.json", "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "required": ["services"], "properties": { "services": { "description": "A list of service configurations", "type": "object", "minProperties": 1, "allOf": [ { "if": { "maxProperties": 1 }, "then": { "patternProperties": { "^[a-z0-9_-]+$": { "properties": { "default": { "default": true } } } } }, "else": { "patternProperties": { "^[a-z0-9_-]+$": { "properties": { "default": { "default": false } } } } } } ], "patternProperties": { "^[a-z0-9_-]+$": { "description": "Configuration for a single service", "type": "object", "additionalProperties": false, "required": ["image"], "allOf": [ { "if": { "properties": { "default": { "const": true } } }, "then": { "properties": { "checkout": { "default": true }, "expose": { "default": 80 } } }, "else": { "properties": { "checkout": { "default": false }, "expose": { "default": null } } } } ], "properties": { "image": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#image", "description": "The Docker image to use for this service", "type": "string", "pattern": "^[a-zA-Z0-9/_:.-]+$" }, "default": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#default", "description": "Whether this is the default Service for a Preview", "type": "boolean" }, "checkout": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#checkout", "description": "Whether to clone the git repository to this Service", "type": "boolean" }, "checkout_path": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#checkout-path", "description": "Where to clone the git repository", "type": "string", "default": "/var/lib/tugboat" }, "depends": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#depends", "description": "List of other Services that this Service depends on", "oneOf": [ { "type": "string", "pattern": "^[a-z0-9_-]+$" }, { "type": "array", "items": { "type": "string", "pattern": "^[a-z0-9_-]+$" } } ] }, "environment": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#environment", "description": "Environment variables to import into the Service's container when it is created", "oneOf": [ { "type": "object", "description": "Environment variables defined as key-value pairs", "patternProperties": { "^[A-Z_][A-Z0-9_]*$": { "type": ["string", "number", "boolean"] } }, "additionalProperties": false }, { "type": "array", "description": "Environment variables defined as NAME=value strings", "items": { "type": "string", "pattern": "^[A-Z_][A-Z0-9_]*=.*$" } }, { "type": "string", "description": "Environment variable defined as NAME=value string", "pattern": "^[A-Z_][A-Z0-9_]*=.*$" } ] }, "commands": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#commands", "title": "Build stage commands", "description": "Commands to run at different stages of the Preview lifecycle. These commands run in sequence: init → update → build → ready → online. Start commands run every time a Preview starts, and clone commands run when creating a new Preview from an existing one.", "type": "object", "additionalProperties": false, "minProperties": 1, "properties": { "init": { "title": "Initialization commands", "description": "Commands that set up the basic Preview infrastructure. These typically include installing required packages, configuring tools, and setting up the environment. These commands run first, before any other build stages. These commands are not run for Previews built from a Base Preview.", "$ref": "#/definitions/commandGroup" }, "update": { "title": "Update commands", "description": "Commands that import data or other assets into a service, such as a database or image files. These commands are not run for Previews built from a Base Preview.", "$ref": "#/definitions/commandGroup" }, "build": { "description": "Commands that build or generate the site, such as compiling styles or running database updates from code", "$ref": "#/definitions/commandGroup" }, "ready": { "description": "Commands that indicate that a service is ready, such as checking for a listening TCP port", "$ref": "#/definitions/commandGroup" }, "online": { "description": "Commands to run once, after a Preview has built, is online, and is ready to accept incoming requests", "$ref": "#/definitions/commandGroup" }, "start": { "description": "Commands that should be run every time a Preview starts", "$ref": "#/definitions/commandGroup" }, "clone": { "description": "Commands that should be run on the cloned (new) Preview that has been created from an existing Preview", "$ref": "#/definitions/commandGroup" } } }, "aliases": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#aliases", "description": "A list of aliases to generate URLs for. Can be a single alias or an array of aliases", "oneOf": [ { "type": "string", "pattern": "^[a-z0-9-]+$" }, { "type": "array", "items": { "type": "string", "pattern": "^[a-z0-9-]+$" } } ] }, "alias_type": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#alias-type", "description": "What kind of aliases to generate", "enum": [ "default", "domain" ], "default": "default" }, "subpath": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#subpath", "description": "Whether subpath URLs should be generated for this Service", "type": "boolean" }, "subpath_map": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#subpath-map", "description": "Whether to map the generated subpath to /", "type": "boolean", "default": true }, "expose": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#expose", "description": "Which port the Service should expose to the Tugboat proxy", "type": "integer" }, "http": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#http", "description": "Whether the Service should be available via HTTP", "type": "boolean", "default": false }, "https": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#https", "description": "Whether the Service should be available via HTTPS", "type": "boolean", "default": true }, "domain": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#domain", "description": "A custom domain for Tugboat to generate URLs with", "type": "string" }, "lighthouse": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#lighthouse", "description": "Lighthouse configurations that affect all of the URLs defined for this Service. Values configured here override the Tugboat default values, but can also be overridden per-URL.", "$ref": "#/definitions/lighthouseOptions" }, "visualdiff": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#visualdiff", "description": "Visual Diff configurations to use for all URLs processed for the Service", "$ref": "#/definitions/visualDiffConfig" }, "screenshot": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#screenshot", "description": "Screenshot configurations to use for all URLs processed for the Service", "$ref": "#/definitions/screenshotConfig", "additionalProperties": false }, "urls": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#urls", "description": "Which URLs should be processed when a Preview has finished building", "oneOf": [ { "description": "URL List - URLs processed with default or Service-level configurations", "type": "array", "items": { "oneOf": [ { "type": "string", "pattern": "^/" }, { "type": "object", "required": ["url"], "properties": { "url": { "type": "string", "pattern": "^/", "description": "The relative URL to process" }, "aliases": { "type": "array", "description": "Use this list of Service aliases when processing this URL", "items": { "type": "string" }, "default": [":default"] }, "lighthouse": { "$ref": "#/definitions/lighthouseOptions" }, "screenshot": { "$ref": "#/definitions/screenshotConfig", "additionalProperties": false }, "visualdiff": { "$ref": "#/definitions/visualDiffConfig" } }, "additionalProperties": false } ] } }, { "description": "Alias Groups - URLs grouped by alias", "type": "object", "patternProperties": { "^(:default|[a-z0-9-]+)$": { "type": "array", "items": { "oneOf": [ { "type": "string", "pattern": "^/" }, { "type": "object", "required": ["url"], "properties": { "url": { "type": "string", "pattern": "^/", "description": "The relative URL to process" }, "lighthouse": { "$ref": "#/definitions/lighthouseOptions" }, "screenshot": { "$ref": "#/definitions/screenshotConfig", "additionalProperties": false }, "visualdiff": { "$ref": "#/definitions/visualDiffConfig" } }, "additionalProperties": false } ] } } }, "additionalProperties": false } ] }, "visualdiffs": { "$comment": "https://docs.tugboatqa.com/reference/tugboat-configuration/#visualdiffs", "description": "DEPRECATED: Use the 'urls' property instead. Which URLs should be processed for visual diffs when a Preview has finished building", "deprecated": true, "oneOf": [ { "type": "array", "items": { "oneOf": [ { "type": "string", "pattern": "^/" }, { "type": "object", "required": ["url"], "properties": { "url": { "type": "string", "pattern": "^/" }, "aliases": { "type": "array", "description": "Only create visual diffs for these Service aliases. The special :default alias can be used to target the automatically generated Service URL (the one with no alias).", "items": { "type": "string", "pattern": "^[a-z0-9-]+$" }, "default": [":default"] }, "waitUntil": { "$ref": "#/definitions/screenshotConfig/properties/waitUntil" }, "fullPage": { "$ref": "#/definitions/screenshotConfig/properties/fullPage" }, "timeout": { "type": "integer", "description": "How long to wait for a page to be ready when taking a screenshot, in seconds. Minimum: 1, Maximum: 60", "minimum": 1, "maximum": 60 } }, "additionalProperties": false } ] } }, { "type": "object", "patternProperties": { "^(:default|[a-z0-9-]+)$": { "type": "array", "items": { "oneOf": [ { "type": "string", "pattern": "^/" }, { "type": "object", "required": ["url"], "properties": { "url": { "type": "string", "pattern": "^/" }, "waitUntil": { "$ref": "#/definitions/screenshotConfig/properties/waitUntil" }, "fullPage": { "$ref": "#/definitions/screenshotConfig/properties/fullPage" }, "timeout": { "type": "integer", "description": "How long to wait for a page to be ready when taking a screenshot, in seconds. Minimum: 1, Maximum: 60", "minimum": 1, "maximum": 60 } }, "additionalProperties": false } ] } } }, "additionalProperties": false } ] } } } } } }, "definitions": { "screenshotConfig": { "type": "object", "properties": { "enabled": { "type": "boolean", "description": "Whether to render Screenshots for the URLs defined for this Service", "default": true }, "fullPage": { "type": "boolean", "description": "Whether to use the default fullPage method. Disabling this uses an alternative that is more friendly to elements that have vh CSS Styles, but can sometimes be less accurate", "default": true }, "timeout": { "type": "integer", "description": "How long to wait for a page to be ready when taking a screenshot, in seconds. Minimum: 1, Maximum: 60", "minimum": 1, "maximum": 60 }, "waitUntil": { "description": "Which browser event(s) to wait for before creating a screenshot of the page. If multiple events are specified, the screenshot is created after all events have fired", "oneOf": [ { "type": "string", "enum": [ "load", "domcontentloaded", "networkidle0", "networkidle2" ] }, { "type": "array", "items": { "type": "string", "enum": [ "load", "domcontentloaded", "networkidle0", "networkidle2" ] }, "uniqueItems": true, "minItems": 1 } ] } } }, "visualDiffConfig": { "type": "object", "properties": { "enabled": { "$ref": "#/definitions/screenshotConfig/properties/enabled" }, "fullPage": { "$ref": "#/definitions/screenshotConfig/properties/fullPage" }, "timeout": { "$ref": "#/definitions/screenshotConfig/properties/timeout" }, "waitUntil": { "$ref": "#/definitions/screenshotConfig/properties/waitUntil" }, "threshold": { "description": "The maximum allowed difference between two screenshots before considering them different. Can be a single value for all screen types, or specific values per screen type", "oneOf": [ { "type": "integer", "description": "Use the same threshold value for all screen types", "minimum": 0, "maximum": 100 }, { "type": "object", "description": "Set different threshold values for specific screen types. Any omitted screen type defaults to 0", "properties": { "desktop": { "type": "integer", "description": "Threshold for desktop screen size", "minimum": 0, "maximum": 100 }, "tablet": { "type": "integer", "description": "Threshold for tablet screen size", "minimum": 0, "maximum": 100 }, "mobile": { "type": "integer", "description": "Threshold for mobile screen size", "minimum": 0, "maximum": 100 } }, "additionalProperties": false } ] } }, "additionalProperties": false }, "lighthouseOptions": { "description": "Tugboat's Lighthouse options for a Service or a URL", "type": "object", "additionalProperties": false, "properties": { "enabled": { "description": "Whether to render Lighthouse Reports for these URLs", "type": "boolean", "default": true }, "config": { "description": "A custom Lighthouse configuration object to use while rendering Lighthouse Reports", "$ref": "#/definitions/lighthouseConfig" }, "screen": { "description": "Which screen sizes to generate Lighthouse Reports for", "type": "array", "uniqueItems": true, "minItems": 1, "items": { "type": "string", "enum": ["desktop", "mobile"] }, "default": ["desktop"] }, "threshold": { "$comment": "https://docs.tugboatqa.com/lighthouse/use-lighthouse-thresholds/#set-thresholds-in-configyml", "$ref": "#/definitions/lighthouseThreshold" } } }, "lighthouseThreshold": { "description": "The Lighthouse thresholds for the reports generated from these URLs. A single value applies to both desktop and mobile. Use the desktop and mobile keys to set each screen separately", "anyOf": [ { "$ref": "#/definitions/lighthouseScreenThreshold" }, { "type": "object", "description": "Set thresholds for each screen. On a Service, a screen that you leave out compares every category to the base report. On a URL, a screen that you leave out keeps the Service threshold", "properties": { "desktop": { "$ref": "#/definitions/lighthouseScreenThreshold" }, "mobile": { "$ref": "#/definitions/lighthouseScreenThreshold" } }, "minProperties": 1, "additionalProperties": false } ] }, "lighthouseScreenThreshold": { "anyOf": [ { "$ref": "#/definitions/lighthouseCategoryThreshold" }, { "type": "array", "description": "Set a threshold for each category. Tugboat doesn't check categories that you leave out", "minItems": 1, "items": { "anyOf": [ { "$ref": "#/definitions/lighthouseCategoryThreshold/anyOf/2" }, { "allOf": [ { "$ref": "#/definitions/lighthouseCategoryThreshold/anyOf/3" }, { "required": ["category"] } ] } ] } } ] }, "lighthouseCategoryThreshold": { "anyOf": [ { "type": "string", "const": "base", "description": "Compare every category to the base report" }, { "type": "number", "minimum": 0, "maximum": 100, "description": "Use the same threshold for every category" }, { "type": "string", "description": "Compare this category to the base report", "enum": ["performance", "accessibility", "best-practices", "seo"] }, { "type": "object", "properties": { "category": { "type": "string", "description": "The category this threshold applies to", "enum": ["performance", "accessibility", "best-practices", "seo"] }, "threshold": { "description": "A score from 0 to 100, or base to use the score of the base report", "anyOf": [ { "type": "string", "const": "base" }, { "type": "number", "minimum": 0, "maximum": 100 } ], "default": "base" }, "tolerance": { "type": "number", "minimum": 0, "maximum": 100, "description": "The number of points a score can fall below its threshold and still pass", "default": 0 } }, "minProperties": 1, "additionalProperties": false } ] }, "lighthouseConfig": { "type": "object", "description": "Configuration options to control Lighthouse's behavior", "$comment": "https://github.com/GoogleChrome/lighthouse/blob/v12.8.2/docs/configuration.md", "properties": { "extends": { "description": "Base configuration to extend from. Currently only 'lighthouse:default' is supported", "$comment": "https://github.com/GoogleChrome/lighthouse/blob/v12.8.2/docs/configuration.md#extends-lighthousedefaultundefined", "type": "string", "enum": ["lighthouse:default"] }, "settings": { "type": "object", "description": "Global settings that control how Lighthouse runs and what audits it includes", "$comment": "https://github.com/GoogleChrome/lighthouse/blob/v12.8.2/docs/configuration.md#settings-objectundefined", "properties": { "onlyCategories": { "description": "Only include the specified categories in the report. Additive with onlyAudits", "type": "array", "items": { "type": "string", "enum": ["performance", "accessibility", "best-practices", "seo"] } }, "onlyAudits": { "description": "Only include the specified audits in the report. Additive with onlyCategories", "type": "array", "items": { "type": "string" } }, "skipAudits": { "description": "Exclude the specified audits from the report. Takes precedence over onlyCategories. An audit ID can't appear in both skipAudits and onlyAudits", "type": "array", "items": { "type": "string" } } } }, "passes": { "description": "Not supported. Lighthouse 10 deprecated passes, Lighthouse 11 removed them, and Lighthouse 12 ignores this key. Use artifacts to choose what Lighthouse collects, and settings to control how it loads the page", "$comment": "https://github.com/GoogleChrome/lighthouse/blob/v12.8.2/docs/configuration.md#artifacts-object", "not": {} }, "artifacts": { "description": "Artifacts to collect during the Lighthouse run. Each artifact names the gatherer that produces it. When the config extends lighthouse:default, an artifact with a new ID is added to the default artifacts, and an artifact with the ID of a default artifact overrides that artifact", "$comment": "https://github.com/GoogleChrome/lighthouse/blob/v12.8.2/docs/configuration.md#artifacts-object", "type": "array", "items": { "type": "object", "required": ["id", "gatherer"], "properties": { "id": { "type": "string", "description": "Unique identifier for the artifact. Audits reference the artifact by this ID" }, "gatherer": { "type": "string", "description": "The gatherer that produces this artifact" } } } }, "audits": { "description": "List of audit IDs to run. Only audits referenced by a category will appear in the report", "$comment": "https://github.com/GoogleChrome/lighthouse/blob/v12.8.2/docs/configuration.md#audits-string", "type": "array", "items": { "type": "string" } }, "categories": { "type": "object", "description": "Categories group audit results into sections in the report. Each category is organized by a set of audit references with their individual scores and grouped by audit groups", "$comment": "https://github.com/GoogleChrome/lighthouse/blob/v12.8.2/docs/configuration.md#categories-objectundefined", "patternProperties": { "^[a-zA-Z0-9-]+$": { "type": "object", "required": ["title", "auditRefs"], "properties": { "title": { "type": "string", "description": "The display name of the category" }, "description": { "type": "string", "description": "A more detailed description of the category's purpose" }, "auditRefs": { "type": "array", "description": "References to audits to include in this category", "items": { "type": "object", "required": ["id", "weight"], "properties": { "id": { "description": "The ID of the audit to include in this category", "type": "string" }, "weight": { "description": "The relative weight of this audit in computing the category score. Higher values mean the audit is more important to the category score", "type": "number" }, "group": { "description": "The ID of the group to place this audit in", "type": "string" } } } } } } } }, "groups": { "type": "object", "description": "Groups organize audits in categories into expandable sections", "$comment": "https://github.com/GoogleChrome/lighthouse/blob/v12.8.2/docs/configuration.md#groups-objectundefined", "patternProperties": { "^[a-zA-Z0-9-]+$": { "type": "object", "required": ["title"], "properties": { "title": { "type": "string", "description": "The display name of the group" }, "description": { "type": "string", "description": "A more detailed description of the group's purpose" } } } } } } }, "commandGroup": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] } } }