deploy_driver.schema.json 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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. "if": {
  67. "properties": {
  68. "source": {
  69. "properties": { "repo": { "const": "https://charts.getporter.dev" } }
  70. }
  71. }
  72. },
  73. "then": {
  74. "properties": {
  75. "config": {
  76. "type": "object",
  77. "description": "resource configuration",
  78. "properties": {
  79. "waitForJob": {
  80. "type": "boolean",
  81. "description": "wait for job to complete"
  82. },
  83. "onlyCreate": {
  84. "type": "boolean",
  85. "description": "only create the resource"
  86. },
  87. "build": {
  88. "type": "object",
  89. "description": "build configuration",
  90. "properties": {
  91. "use_cache": {
  92. "type": "boolean",
  93. "description": "use Porter build cache"
  94. },
  95. "method": {
  96. "type": "string",
  97. "description": "build method",
  98. "default": "docker",
  99. "enum": ["docker", "pack", "registry"]
  100. },
  101. "context": {
  102. "type": "string",
  103. "description": "build context"
  104. },
  105. "dockerfile": {
  106. "type": "string",
  107. "description": "Dockerfile path"
  108. },
  109. "image": {
  110. "type": "string",
  111. "description": "image name"
  112. },
  113. "builder": {
  114. "type": "string",
  115. "description": "buildpacks builder image"
  116. },
  117. "buildpacks": {
  118. "type": "array",
  119. "description": "list of buildpacks",
  120. "minItems": 1,
  121. "items": {
  122. "type": "string",
  123. "description": "buildpack"
  124. }
  125. },
  126. "env": {
  127. "type": "object",
  128. "description": "build-time environment variables",
  129. "additionalProperties": { "type": "string" }
  130. }
  131. },
  132. "allOf": [
  133. {
  134. "if": {
  135. "properties": {
  136. "method": { "const": "docker" }
  137. }
  138. },
  139. "then": {
  140. "dependentRequired": {
  141. "method": ["dockerfile"]
  142. }
  143. }
  144. },
  145. {
  146. "if": {
  147. "properties": {
  148. "method": { "const": "registry" }
  149. }
  150. },
  151. "then": {
  152. "dependentRequired": {
  153. "method": ["image"]
  154. }
  155. }
  156. }
  157. ]
  158. },
  159. "env_groups": {
  160. "type": "array",
  161. "description": "list of environment groups to use in the deployment",
  162. "minItems": 1,
  163. "items": {
  164. "type": "object",
  165. "description": "environment group",
  166. "properties": {
  167. "name": {
  168. "type": "string",
  169. "description": "environment group name"
  170. },
  171. "version": {
  172. "type": "integer",
  173. "minimum": 0,
  174. "default": 0,
  175. "description": "environment group version"
  176. },
  177. "namespace": {
  178. "type": "string",
  179. "description": "environment group namespace"
  180. }
  181. },
  182. "required": ["name"]
  183. }
  184. },
  185. "values": {
  186. "type": "object",
  187. "description": "Helm values to use for the deployment",
  188. "additionalProperties": true
  189. }
  190. }
  191. }
  192. }
  193. }
  194. },
  195. "required": ["name"]
  196. }