{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "Configuration for Rush's build cache.", "description": "For use with the Rush tool, this file provides configuration options for cached project build output. See http://rushjs.io for details.", "definitions": { "anything": { "type": ["array", "boolean", "integer", "number", "object", "string"], "items": { "$ref": "#/definitions/anything" } }, "entraLoginFlow": { "type": "string", "description": "The Primary Entra ID login flow to use. Defaults to 'AdoCodespacesAuth' on GitHub Codespaces, 'VisualStudioCode' otherwise. If this flow fails it will fall back based on the configuration in `loginFlowFailover`.", "enum": [ "AdoCodespacesAuth", "InteractiveBrowser", "DeviceCode", "VisualStudioCode", "AzureCli", "AzureDeveloperCli", "AzurePowerShell" ] }, "fallbackEntraLoginFlow": { "$ref": "#/definitions/entraLoginFlow", "description": "The Entra ID login flow to fall back to. If null, a failure in this login mode is terminal." } }, "type": "object", "allOf": [ { "type": "object", "additionalProperties": false, "required": ["buildCacheEnabled", "cacheProvider"], "properties": { "$schema": { "description": "Part of the JSON Schema standard, this optional keyword declares the URL of the schema that the file conforms to. Editors may download the schema and use it to perform syntax highlighting.", "type": "string" }, "buildCacheEnabled": { "description": "Set this to true to enable the build cache feature.", "type": "boolean" }, "cacheProvider": { "description": "Specify the cache provider to use", "type": "string" }, "cacheEntryNamePattern": { "type": "string", "description": "Setting this property overrides the cache entry ID. If this property is set, it must contain a [hash] token. It may also contain one of the following tokens: [projectName], [projectName:normalize], [phaseName], [phaseName:normalize], [phaseName:trimPrefix], [os], and [arch]." }, "cacheHashSalt": { "type": "string", "description": "An optional salt to inject during calculation of the cache key. This can be used to invalidate the cache for all projects when the salt changes." }, "azureBlobStorageConfiguration": { "type": "object", "additionalProperties": false, "properties": { "storageAccountName": { "type": "string", "description": "(Required) The name of the the Azure storage account to use for build cache." }, "storageContainerName": { "type": "string", "description": "(Required) The name of the container in the Azure storage account to use for build cache." }, "azureEnvironment": { "type": "string", "description": "The Azure environment the storage account exists in. Defaults to AzurePublicCloud.", "enum": ["AzurePublicCloud", "AzureChina", "AzureGermany", "AzureGovernment"] }, "storageEndpoint": { "type": "string", "description": "An optional custom endpoint URL for the Azure Blob Storage account. Use this to connect to Azurite, private endpoints, or storage emulators. When specified, this overrides the default endpoint derived from storageAccountName. The URL must start with \"http://\" or \"https://\". A credential saved by \"rush update-cloud-credentials\" is used only with the endpoint that it was saved for. An Azure login (\"rush update-cloud-credentials --interactive\") needs an \"https://\" endpoint. For an \"http://\" endpoint, such as Azurite, provide a SAS token with \"rush update-cloud-credentials --credential\" or the RUSH_BUILD_CACHE_CREDENTIAL environment variable, or read without a credential. Example: \"http://127.0.0.1:10000/devstoreaccount1\" or \"https://my-proxy.example.com/devstoreaccount1\"", "format": "uri", "pattern": "^[Hh][Tt][Tt][Pp][Ss]?://" }, "loginFlow": { "$ref": "#/definitions/entraLoginFlow" }, "loginFlowFailover": { "type": "object", "description": "Optional configuration for a fallback login flow if the primary login flow fails. If not defined, the default order is: AdoCodespacesAuth -> VisualStudioCode -> AzureCli -> AzureDeveloperCli -> AzurePowerShell -> InteractiveBrowser -> DeviceCode.", "additionalProperties": false, "properties": { "AdoCodespacesAuth": { "allOf": [ { "$ref": "#/definitions/fallbackEntraLoginFlow" }, { "not": { "enum": ["AdoCodespacesAuth"] } } ] }, "InteractiveBrowser": { "allOf": [ { "$ref": "#/definitions/fallbackEntraLoginFlow" }, { "not": { "enum": ["InteractiveBrowser"] } } ] }, "DeviceCode": { "allOf": [ { "$ref": "#/definitions/fallbackEntraLoginFlow" }, { "not": { "enum": ["DeviceCode"] } } ] }, "VisualStudioCode": { "allOf": [ { "$ref": "#/definitions/fallbackEntraLoginFlow" }, { "not": { "enum": ["VisualStudioCode"] } } ] }, "AzureCli": { "allOf": [ { "$ref": "#/definitions/fallbackEntraLoginFlow" }, { "not": { "enum": ["AzureCli"] } } ] }, "AzureDeveloperCli": { "allOf": [ { "$ref": "#/definitions/fallbackEntraLoginFlow" }, { "not": { "enum": ["AzureDeveloperCli"] } } ] }, "AzurePowerShell": { "allOf": [ { "$ref": "#/definitions/fallbackEntraLoginFlow" }, { "not": { "enum": ["AzurePowerShell"] } } ] } } }, "blobPrefix": { "type": "string", "description": "An optional prefix for cache item blob names." }, "isCacheWriteAllowed": { "type": "boolean", "description": "If set to true, allow writing to the cache. Defaults to false." }, "readRequiresAuthentication": { "type": "boolean", "description": "If set to true, reading the cache requires authentication. Defaults to false." } } }, "amazonS3Configuration": { "type": "object", "additionalProperties": false, "properties": { "s3Bucket": { "type": "string", "description": "(Required unless s3Endpoint is specified) The name of the bucket to use for build cache (e.g. \"my-bucket\")." }, "s3Endpoint": { "type": "string", "description": "(Required unless s3Bucket is specified) The Amazon S3 endpoint of the bucket to use for build cache (e.g. \"my-bucket.s3.us-east-2.amazonaws.com\" or \"http://localhost:9000\").\nThis shold not include any path, use the s3Prefix to set the path." }, "s3Region": { "type": "string", "description": "(Required) The Amazon S3 region of the bucket to use for build cache (e.g. \"us-east-1\")." }, "s3Prefix": { "type": "string", "description": "An optional prefix (\"folder\") for cache items. Should not start with /" }, "isCacheWriteAllowed": { "type": "boolean", "description": "If set to true, allow writing to the cache. Defaults to false." } } }, "httpConfiguration": { "type": "object", "additionalProperties": false, "properties": { "url": { "type": "string", "description": "(Required) The URL of the server that stores the caches (e.g. \"https://build-caches.example.com\").", "format": "uri" }, "uploadMethod": { "type": "string", "description": "(Optional) The HTTP method to use when writing to the cache (defaults to PUT).", "enum": ["PUT", "POST", "PATCH"], "default": "PUT" }, "headers": { "type": "object", "description": "(Optional) HTTP headers to pass to the cache server", "properties": {}, "additionalProperties": { "type": "string" } }, "tokenHandler": { "type": "object", "description": "(Optional) Shell command that prints the authorization token needed to communicate with the HTTPS server and exits with code 0. This command will be executed from the root of the monorepo.", "properties": { "exec": { "type": "string", "description": "(Required) The command or script to execute." }, "args": { "type": "array", "description": "(Optional) Arguments to pass to the command or script.", "items": { "type": "string" } } } }, "cacheKeyPrefix": { "type": "string", "description": "(Optional) prefix for cache keys." }, "isCacheWriteAllowed": { "type": "boolean", "description": "(Optional) If set to true, allow writing to the cache. Defaults to false." } } } }, "oneOf": [ { "type": "object", "additionalProperties": true, "properties": { "cacheProvider": { "type": "string", "pattern": "^(?:(?!local-only|azure-blob-storage|amazon-s3|http).)*$" } } }, { "type": "object", "additionalProperties": true, "properties": { "cacheProvider": { "type": "string", "enum": ["local-only"] } } }, { "type": "object", "additionalProperties": true, "properties": { "cacheProvider": { "type": "string", "enum": ["azure-blob-storage"] }, "azureBlobStorageConfiguration": { "type": "object", "additionalProperties": true, "required": ["storageAccountName", "storageContainerName"], "properties": { "storageAccountName": { "$ref": "#/definitions/anything" }, "storageContainerName": { "$ref": "#/definitions/anything" } } } } }, { "type": "object", "additionalProperties": true, "properties": { "cacheProvider": { "type": "string", "enum": ["amazon-s3"] }, "amazonS3Configuration": { "type": "object", "additionalProperties": true, "oneOf": [ { "type": "object", "required": ["s3Region", "s3Endpoint"], "properties": { "s3Endpoint": { "$ref": "#/definitions/anything" }, "s3Region": { "$ref": "#/definitions/anything" } } }, { "type": "object", "required": ["s3Region", "s3Bucket"], "properties": { "s3Bucket": { "$ref": "#/definitions/anything" }, "s3Region": { "$ref": "#/definitions/anything" } } } ] } } }, { "type": "object", "additionalProperties": true, "properties": { "cacheProvider": { "type": "string", "enum": ["http"] }, "httpConfiguration": { "type": "object", "additionalProperties": true, "required": ["url"], "properties": { "url": { "$ref": "#/definitions/anything" } } } } } ] } ] }