deploy_driver.schema.json 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. {
  2. "$schema": "http://json-schema.org/schema#",
  3. "title": "schema for the default deploy driver",
  4. "type": "object",
  5. "properties": {
  6. "name": {
  7. "type": "string",
  8. "description": "resource name",
  9. "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
  10. "maxLength": 50
  11. },
  12. "driver": {
  13. "type": "string",
  14. "description": "resource driver",
  15. "enum": ["deploy", ""]
  16. },
  17. "depends_on": {
  18. "type": "array",
  19. "description": "list of resource names this resource depends on",
  20. "minItems": 1,
  21. "items": {
  22. "type": "string",
  23. "description": "dependency resource name",
  24. "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
  25. "maxLength": 50
  26. }
  27. },
  28. "source": {
  29. "type": "object",
  30. "description": "resource source",
  31. "properties": {
  32. "name": {
  33. "type": "string",
  34. "description": "source Helm chart name"
  35. },
  36. "version": {
  37. "type": "string",
  38. "description": "source Helm chart version"
  39. },
  40. "repo": {
  41. "type": "string",
  42. "description": "source Helm chart repo URL",
  43. "default": "https://charts.getporter.dev"
  44. }
  45. },
  46. "required": ["name"]
  47. },
  48. "target": {
  49. "type": "object",
  50. "description": "resource target",
  51. "properties": {
  52. "project": {
  53. "type": "integer",
  54. "description": "target Porter project ID"
  55. },
  56. "cluster": {
  57. "type": "integer",
  58. "description": "target Porter cluster ID"
  59. },
  60. "namespace": {
  61. "type": "string",
  62. "description": "target namespace"
  63. }
  64. }
  65. },
  66. "config": {
  67. "type": "object",
  68. "description": "resource configuration",
  69. "additionalProperties": true
  70. },
  71. "if": {
  72. "properties": {
  73. "source": {
  74. "properties": { "repo": { "const": "https://charts.getporter.dev" } }
  75. }
  76. }
  77. },
  78. "then": {
  79. "properties": {
  80. "config": {
  81. "properties": {
  82. "waitForJob": {
  83. "type": "boolean",
  84. "description": "wait for job to complete"
  85. },
  86. "onlyCreate": {
  87. "type": "boolean",
  88. "description": "only create the resource"
  89. },
  90. "build": {
  91. "type": "object",
  92. "description": "build configuration",
  93. "properties": {
  94. "use_cache": {
  95. "type": "boolean",
  96. "description": "use Porter build cache"
  97. },
  98. "method": {
  99. "type": "string",
  100. "description": "build method",
  101. "default": "docker",
  102. "enum": ["docker", "pack", "registry"]
  103. },
  104. "context": {
  105. "type": "string",
  106. "description": "build context"
  107. },
  108. "dockerfile": {
  109. "type": "string",
  110. "description": "Dockerfile path"
  111. },
  112. "image": {
  113. "type": "string",
  114. "description": "image name"
  115. },
  116. "builder": {
  117. "type": "string",
  118. "description": "buildpacks builder image"
  119. },
  120. "buildpacks": {
  121. "type": "array",
  122. "description": "list of buildpacks",
  123. "minItems": 1,
  124. "items": {
  125. "type": "string",
  126. "description": "buildpack"
  127. }
  128. },
  129. "env": {
  130. "type": "object",
  131. "description": "build-time environment variables",
  132. "additionalProperties": { "type": "string" }
  133. }
  134. },
  135. "allOf": [
  136. {
  137. "if": {
  138. "properties": {
  139. "method": { "const": "docker" }
  140. }
  141. },
  142. "then": {
  143. "dependentRequired": {
  144. "method": ["dockerfile"]
  145. }
  146. }
  147. },
  148. {
  149. "if": {
  150. "properties": {
  151. "method": { "const": "registry" }
  152. }
  153. },
  154. "then": {
  155. "dependentRequired": {
  156. "method": ["image"]
  157. }
  158. }
  159. }
  160. ]
  161. },
  162. "env_groups": {
  163. "type": "array",
  164. "description": "list of environment groups to use in the deployment",
  165. "minItems": 1,
  166. "items": {
  167. "type": "object",
  168. "description": "environment group",
  169. "properties": {
  170. "name": {
  171. "type": "string",
  172. "description": "environment group name"
  173. },
  174. "version": {
  175. "type": "integer",
  176. "minimum": 0,
  177. "default": 0,
  178. "description": "environment group version"
  179. },
  180. "namespace": {
  181. "type": "string",
  182. "description": "environment group namespace"
  183. }
  184. },
  185. "required": ["name"]
  186. }
  187. },
  188. "values": {
  189. "type": "object",
  190. "description": "Helm values to use for the deployment",
  191. "additionalProperties": true
  192. }
  193. },
  194. "required": ["build"]
  195. }
  196. },
  197. "required": ["config"]
  198. }
  199. },
  200. "required": ["name", "source"]
  201. }