build-cache.json 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /**
  2. * This configuration file manages Rush's build cache feature.
  3. * More documentation is available on the Rush website: https://rushjs.io
  4. */
  5. {
  6. "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/build-cache.schema.json",
  7. /**
  8. * (Required) EXPERIMENTAL - Set this to true to enable the build cache feature.
  9. *
  10. * See https://rushjs.io/pages/maintainer/build_cache/ for details about this experimental feature.
  11. */
  12. "buildCacheEnabled": false,
  13. /**
  14. * (Required) Choose where project build outputs will be cached.
  15. *
  16. * Possible values: "local-only", "azure-blob-storage", "amazon-s3"
  17. */
  18. "cacheProvider": "local-only",
  19. /**
  20. * Setting this property overrides the cache entry ID. If this property is set, it must contain
  21. * a [hash] token.
  22. *
  23. * Other available tokens:
  24. * - [projectName] Example: "@my-scope/my-project"
  25. * - [projectName:normalize] Example: "my-scope+my-project"
  26. * - [phaseName] Example: "_phase:test/api"
  27. * - [phaseName:normalize] Example: "_phase:test+api"
  28. * - [phaseName:trimPrefix] Example: "test/api"
  29. * - [os] Example: "win32"
  30. * - [arch] Example: "x64"
  31. */
  32. // "cacheEntryNamePattern": "[projectName:normalize]-[phaseName:normalize]-[hash]"
  33. /**
  34. * (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.
  35. */
  36. // "cacheHashSalt": "1",
  37. /**
  38. * Use this configuration with "cacheProvider"="azure-blob-storage"
  39. */
  40. "azureBlobStorageConfiguration": {
  41. /**
  42. * (Required) The name of the the Azure storage account to use for build cache.
  43. */
  44. // "storageAccountName": "example",
  45. /**
  46. * (Required) The name of the container in the Azure storage account to use for build cache.
  47. */
  48. // "storageContainerName": "my-container",
  49. /**
  50. * The Azure environment the storage account exists in. Defaults to AzurePublicCloud.
  51. *
  52. * Possible values: "AzurePublicCloud", "AzureChina", "AzureGermany", "AzureGovernment"
  53. */
  54. // "azureEnvironment": "AzurePublicCloud",
  55. /**
  56. * An optional prefix for cache item blob names.
  57. */
  58. // "blobPrefix": "my-prefix",
  59. /**
  60. * If set to true, allow writing to the cache. Defaults to false.
  61. */
  62. // "isCacheWriteAllowed": true
  63. },
  64. /**
  65. * Use this configuration with "cacheProvider"="amazon-s3"
  66. */
  67. "amazonS3Configuration": {
  68. /**
  69. * (Required unless s3Endpoint is specified) The name of the bucket to use for build cache.
  70. * Example: "my-bucket"
  71. */
  72. // "s3Bucket": "my-bucket",
  73. /**
  74. * (Required unless s3Bucket is specified) The Amazon S3 endpoint of the bucket to use for build cache.
  75. * This should not include any path; use the s3Prefix to set the path.
  76. * Examples: "my-bucket.s3.us-east-2.amazonaws.com" or "http://localhost:9000"
  77. */
  78. // "s3Endpoint": "https://my-bucket.s3.us-east-2.amazonaws.com",
  79. /**
  80. * (Required) The Amazon S3 region of the bucket to use for build cache.
  81. * Example: "us-east-1"
  82. */
  83. // "s3Region": "us-east-1",
  84. /**
  85. * An optional prefix ("folder") for cache items. It should not start with "/".
  86. */
  87. // "s3Prefix": "my-prefix",
  88. /**
  89. * If set to true, allow writing to the cache. Defaults to false.
  90. */
  91. // "isCacheWriteAllowed": true
  92. },
  93. /**
  94. * Use this configuration with "cacheProvider"="http"
  95. */
  96. "httpConfiguration": {
  97. /**
  98. * (Required) The URL of the server that stores the caches.
  99. * Example: "https://build-cacches.example.com/"
  100. */
  101. // "url": "https://build-cacches.example.com/",
  102. /**
  103. * (Optional) The HTTP method to use when writing to the cache (defaults to PUT).
  104. * Should be one of PUT, POST, or PATCH.
  105. * Example: "PUT"
  106. */
  107. // "uploadMethod": "PUT",
  108. /**
  109. * (Optional) HTTP headers to pass to the cache server.
  110. * Example: { "X-HTTP-Company-Id": "109283" }
  111. */
  112. // "headers": {},
  113. /**
  114. * (Optional) Shell command that prints the authorization token needed to communicate with the
  115. * cache server, and exits with exit code 0. This command will be executed from the root of
  116. * the monorepo.
  117. * Example: { "exec": "node", "args": ["common/scripts/auth.js"] }
  118. */
  119. // "tokenHandler": { "exec": "node", "args": ["common/scripts/auth.js"] },
  120. /**
  121. * (Optional) Prefix for cache keys.
  122. * Example: "my-company-"
  123. */
  124. // "cacheKeyPrefix": "",
  125. /**
  126. * (Optional) If set to true, allow writing to the cache. Defaults to false.
  127. */
  128. // "isCacheWriteAllowed": true
  129. }
  130. }