kubes 0.1.0 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (384) hide show
  1. checksums.yaml +5 -5
  2. data/.dockerignore +4 -0
  3. data/.gitignore +15 -7
  4. data/.rspec +3 -0
  5. data/CHANGELOG.md +22 -0
  6. data/Dockerfile +14 -0
  7. data/Gemfile +3 -1
  8. data/Guardfile +19 -0
  9. data/LICENSE.txt +201 -0
  10. data/README.md +46 -18
  11. data/Rakefile +13 -1
  12. data/docs/.gitignore +5 -0
  13. data/docs/CNAME +1 -0
  14. data/docs/Gemfile +16 -0
  15. data/docs/LICENSE +201 -0
  16. data/docs/Procfile +2 -0
  17. data/docs/README.md +24 -0
  18. data/docs/Rakefile +38 -0
  19. data/docs/_config.yml +71 -0
  20. data/docs/_docs/auto-context.md +47 -0
  21. data/docs/_docs/ci/cloudbuild.md +69 -0
  22. data/docs/_docs/config.md +9 -0
  23. data/docs/_docs/config/docker.md +70 -0
  24. data/docs/_docs/config/env.md +58 -0
  25. data/docs/_docs/config/kubectl.md +61 -0
  26. data/docs/_docs/contributing.md +98 -0
  27. data/docs/_docs/dsl.md +66 -0
  28. data/docs/_docs/dsl/multiple-resources.md +114 -0
  29. data/docs/_docs/dsl/resources.md +12 -0
  30. data/docs/_docs/dsl/resources/backend_config.md +45 -0
  31. data/docs/_docs/dsl/resources/config_map.md +84 -0
  32. data/docs/_docs/dsl/resources/daemon_set.md +58 -0
  33. data/docs/_docs/dsl/resources/deployment.md +137 -0
  34. data/docs/_docs/dsl/resources/generic.md +58 -0
  35. data/docs/_docs/dsl/resources/ingress.md +103 -0
  36. data/docs/_docs/dsl/resources/managed_certificate.md +39 -0
  37. data/docs/_docs/dsl/resources/namespace.md +34 -0
  38. data/docs/_docs/dsl/resources/network_policy.md +111 -0
  39. data/docs/_docs/dsl/resources/pod.md +82 -0
  40. data/docs/_docs/dsl/resources/role.md +44 -0
  41. data/docs/_docs/dsl/resources/role_binding.md +55 -0
  42. data/docs/_docs/dsl/resources/secret.md +87 -0
  43. data/docs/_docs/dsl/resources/service.md +60 -0
  44. data/docs/_docs/dsl/resources/service_account.md +37 -0
  45. data/docs/_docs/extra-env.md +23 -0
  46. data/docs/_docs/extra-env/dsl.md +86 -0
  47. data/docs/_docs/extra-env/yaml.md +67 -0
  48. data/docs/_docs/helpers.md +19 -0
  49. data/docs/_docs/intro.md +15 -0
  50. data/docs/_docs/intro/concepts.md +37 -0
  51. data/docs/_docs/intro/how-kubes-works.md +29 -0
  52. data/docs/_docs/intro/install.md +6 -0
  53. data/docs/_docs/intro/ordering.md +63 -0
  54. data/docs/_docs/intro/ordering/custom.md +25 -0
  55. data/docs/_docs/intro/structure.md +43 -0
  56. data/docs/_docs/kustomize.md +54 -0
  57. data/docs/_docs/layering.md +8 -0
  58. data/docs/_docs/layering/dsl.md +5 -0
  59. data/docs/_docs/layering/merge.md +96 -0
  60. data/docs/_docs/layering/yaml.md +5 -0
  61. data/docs/_docs/learn/dsl.md +5 -0
  62. data/docs/_docs/learn/dsl/change.md +16 -0
  63. data/docs/_docs/learn/dsl/cluster.md +5 -0
  64. data/docs/_docs/learn/dsl/delete.md +32 -0
  65. data/docs/_docs/learn/dsl/deploy.md +66 -0
  66. data/docs/_docs/learn/dsl/install.md +5 -0
  67. data/docs/_docs/learn/dsl/new-project.md +34 -0
  68. data/docs/_docs/learn/dsl/next-steps.md +5 -0
  69. data/docs/_docs/learn/dsl/review-project.md +63 -0
  70. data/docs/_docs/learn/dsl/update.md +53 -0
  71. data/docs/_docs/learn/yaml.md +5 -0
  72. data/docs/_docs/learn/yaml/change.md +17 -0
  73. data/docs/_docs/learn/yaml/cluster.md +5 -0
  74. data/docs/_docs/learn/yaml/delete.md +32 -0
  75. data/docs/_docs/learn/yaml/deploy.md +67 -0
  76. data/docs/_docs/learn/yaml/install.md +5 -0
  77. data/docs/_docs/learn/yaml/new-project.md +37 -0
  78. data/docs/_docs/learn/yaml/next-steps.md +5 -0
  79. data/docs/_docs/learn/yaml/review-project.md +108 -0
  80. data/docs/_docs/learn/yaml/update.md +54 -0
  81. data/docs/_docs/next-steps.md +13 -0
  82. data/docs/_docs/patterns.md +7 -0
  83. data/docs/_docs/patterns/clock-web-worker.md +71 -0
  84. data/docs/_docs/resources.md +11 -0
  85. data/docs/_docs/resources/base.md +33 -0
  86. data/docs/_docs/resources/role.md +41 -0
  87. data/docs/_docs/resources/shared.md +36 -0
  88. data/docs/_docs/yaml.md +41 -0
  89. data/docs/_includes/commands.html +131 -0
  90. data/docs/_includes/content.html +25 -0
  91. data/docs/_includes/dsl/methods.md +1 -0
  92. data/docs/_includes/dsl/rolling_deployment.md +1 -0
  93. data/docs/_includes/dsl/suffix_hash.md +8 -0
  94. data/docs/_includes/example.html +12 -0
  95. data/docs/_includes/footer.html +37 -0
  96. data/docs/_includes/google_analytics.html +10 -0
  97. data/docs/_includes/header.html +31 -0
  98. data/docs/_includes/intro/install.md +15 -0
  99. data/docs/_includes/js.html +3 -0
  100. data/docs/_includes/kubes-steps.md +3 -0
  101. data/docs/_includes/layering/layers.md +64 -0
  102. data/docs/_includes/learn/cluster.md +22 -0
  103. data/docs/_includes/learn/next-steps.md +6 -0
  104. data/docs/_includes/learn/review.md +27 -0
  105. data/docs/_includes/learn/start.md +3 -0
  106. data/docs/_includes/reference.md +3 -0
  107. data/docs/_includes/sidebar.html +118 -0
  108. data/docs/_layouts/default.html +35 -0
  109. data/docs/_reference/kubes-apply.md +24 -0
  110. data/docs/_reference/kubes-clean.md +22 -0
  111. data/docs/_reference/kubes-compile.md +22 -0
  112. data/docs/_reference/kubes-completion.md +42 -0
  113. data/docs/_reference/kubes-completion_script.md +25 -0
  114. data/docs/_reference/kubes-delete.md +23 -0
  115. data/docs/_reference/kubes-deploy.md +35 -0
  116. data/docs/_reference/kubes-docker-build.md +20 -0
  117. data/docs/_reference/kubes-docker-help.md +15 -0
  118. data/docs/_reference/kubes-docker-push.md +20 -0
  119. data/docs/_reference/kubes-docker.md +25 -0
  120. data/docs/_reference/kubes-init.md +26 -0
  121. data/docs/_reference/kubes-version.md +21 -0
  122. data/docs/_sass/bootstrap-overrides.scss +17 -0
  123. data/docs/_sass/buttons.scss +62 -0
  124. data/docs/_sass/caret.scss +39 -0
  125. data/docs/_sass/content.scss +21 -0
  126. data/docs/_sass/cta.scss +39 -0
  127. data/docs/_sass/default.scss +103 -0
  128. data/docs/_sass/footer.scss +66 -0
  129. data/docs/_sass/masthead.scss +77 -0
  130. data/docs/_sass/mixins.scss +79 -0
  131. data/docs/_sass/sidebar.scss +107 -0
  132. data/docs/_sass/syntax.scss +89 -0
  133. data/docs/_sass/table.scss +30 -0
  134. data/docs/_sass/theme.scss +292 -0
  135. data/docs/_sass/variables.scss +24 -0
  136. data/docs/bin/build +4 -0
  137. data/docs/bin/rerun +2 -0
  138. data/docs/bin/web +8 -0
  139. data/docs/css/main.scss +24 -0
  140. data/docs/docs.md +7 -0
  141. data/docs/getting-started.md +12 -0
  142. data/docs/img/logos/boltops-logo-full.png +0 -0
  143. data/docs/img/logos/boltops-logo.png +0 -0
  144. data/docs/img/logos/filler-logo.png +0 -0
  145. data/docs/img/logos/kubes-black.png +0 -0
  146. data/docs/img/logos/kubes-sign.png +0 -0
  147. data/docs/index.html +34 -0
  148. data/docs/js/app.js +39414 -0
  149. data/docs/opal/app.rb +16 -0
  150. data/docs/opal/pager.rb +90 -0
  151. data/docs/opal/sidebar.rb +94 -0
  152. data/docs/opal/sidebar/expander.rb +51 -0
  153. data/docs/reference.md +15 -0
  154. data/docs/support.md +19 -0
  155. data/docs/vendor/bootstrap/css/bootstrap-grid.css +3719 -0
  156. data/docs/vendor/bootstrap/css/bootstrap-grid.css.map +1 -0
  157. data/docs/vendor/bootstrap/css/bootstrap-grid.min.css +7 -0
  158. data/docs/vendor/bootstrap/css/bootstrap-grid.min.css.map +1 -0
  159. data/docs/vendor/bootstrap/css/bootstrap-reboot.css +331 -0
  160. data/docs/vendor/bootstrap/css/bootstrap-reboot.css.map +1 -0
  161. data/docs/vendor/bootstrap/css/bootstrap-reboot.min.css +8 -0
  162. data/docs/vendor/bootstrap/css/bootstrap-reboot.min.css.map +1 -0
  163. data/docs/vendor/bootstrap/css/bootstrap.css +10038 -0
  164. data/docs/vendor/bootstrap/css/bootstrap.css.map +1 -0
  165. data/docs/vendor/bootstrap/css/bootstrap.min.css +7 -0
  166. data/docs/vendor/bootstrap/css/bootstrap.min.css.map +1 -0
  167. data/docs/vendor/bootstrap/js/bootstrap.bundle.js +7013 -0
  168. data/docs/vendor/bootstrap/js/bootstrap.bundle.js.map +1 -0
  169. data/docs/vendor/bootstrap/js/bootstrap.bundle.min.js +7 -0
  170. data/docs/vendor/bootstrap/js/bootstrap.bundle.min.js.map +1 -0
  171. data/docs/vendor/bootstrap/js/bootstrap.js +4435 -0
  172. data/docs/vendor/bootstrap/js/bootstrap.js.map +1 -0
  173. data/docs/vendor/bootstrap/js/bootstrap.min.js +7 -0
  174. data/docs/vendor/bootstrap/js/bootstrap.min.js.map +1 -0
  175. data/docs/vendor/font-awesome/css/font-awesome.css +2337 -0
  176. data/docs/vendor/font-awesome/css/font-awesome.min.css +4 -0
  177. data/docs/vendor/font-awesome/fonts/FontAwesome.otf +0 -0
  178. data/docs/vendor/font-awesome/fonts/fontawesome-webfont.eot +0 -0
  179. data/docs/vendor/font-awesome/fonts/fontawesome-webfont.svg +2671 -0
  180. data/docs/vendor/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
  181. data/docs/vendor/font-awesome/fonts/fontawesome-webfont.woff +0 -0
  182. data/docs/vendor/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
  183. data/docs/vendor/font-awesome/less/animated.less +34 -0
  184. data/docs/vendor/font-awesome/less/bordered-pulled.less +25 -0
  185. data/docs/vendor/font-awesome/less/core.less +12 -0
  186. data/docs/vendor/font-awesome/less/fixed-width.less +6 -0
  187. data/docs/vendor/font-awesome/less/font-awesome.less +18 -0
  188. data/docs/vendor/font-awesome/less/icons.less +789 -0
  189. data/docs/vendor/font-awesome/less/larger.less +13 -0
  190. data/docs/vendor/font-awesome/less/list.less +19 -0
  191. data/docs/vendor/font-awesome/less/mixins.less +60 -0
  192. data/docs/vendor/font-awesome/less/path.less +15 -0
  193. data/docs/vendor/font-awesome/less/rotated-flipped.less +20 -0
  194. data/docs/vendor/font-awesome/less/screen-reader.less +5 -0
  195. data/docs/vendor/font-awesome/less/stacked.less +20 -0
  196. data/docs/vendor/font-awesome/less/variables.less +799 -0
  197. data/docs/vendor/font-awesome/scss/_animated.scss +34 -0
  198. data/docs/vendor/font-awesome/scss/_bordered-pulled.scss +25 -0
  199. data/docs/vendor/font-awesome/scss/_core.scss +12 -0
  200. data/docs/vendor/font-awesome/scss/_fixed-width.scss +6 -0
  201. data/docs/vendor/font-awesome/scss/_icons.scss +789 -0
  202. data/docs/vendor/font-awesome/scss/_larger.scss +13 -0
  203. data/docs/vendor/font-awesome/scss/_list.scss +19 -0
  204. data/docs/vendor/font-awesome/scss/_mixins.scss +60 -0
  205. data/docs/vendor/font-awesome/scss/_path.scss +15 -0
  206. data/docs/vendor/font-awesome/scss/_rotated-flipped.scss +20 -0
  207. data/docs/vendor/font-awesome/scss/_screen-reader.scss +5 -0
  208. data/docs/vendor/font-awesome/scss/_stacked.scss +20 -0
  209. data/docs/vendor/font-awesome/scss/_variables.scss +799 -0
  210. data/docs/vendor/font-awesome/scss/font-awesome.scss +18 -0
  211. data/docs/vendor/jquery/jquery.js +10598 -0
  212. data/docs/vendor/jquery/jquery.min.js +2 -0
  213. data/docs/vendor/jquery/jquery.min.map +1 -0
  214. data/docs/vendor/jquery/jquery.slim.js +8495 -0
  215. data/docs/vendor/jquery/jquery.slim.min.js +2 -0
  216. data/docs/vendor/jquery/jquery.slim.min.map +1 -0
  217. data/docs/vendor/simple-line-icons/css/simple-line-icons.css +778 -0
  218. data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.eot +0 -0
  219. data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.svg +200 -0
  220. data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.ttf +0 -0
  221. data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.woff +0 -0
  222. data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.woff2 +0 -0
  223. data/docs/vendor/simple-line-icons/less/simple-line-icons.less +982 -0
  224. data/docs/vendor/simple-line-icons/scss/simple-line-icons.scss +979 -0
  225. data/exe/kubes +14 -0
  226. data/kubes.gemspec +29 -19
  227. data/lib/kubes.rb +21 -1
  228. data/lib/kubes/args/custom.rb +30 -0
  229. data/lib/kubes/args/dsl.rb +14 -0
  230. data/lib/kubes/auth.rb +21 -0
  231. data/lib/kubes/auth/ecr.rb +55 -0
  232. data/lib/kubes/autoloader.rb +21 -0
  233. data/lib/kubes/aws_services.rb +14 -0
  234. data/lib/kubes/cli.rb +93 -0
  235. data/lib/kubes/cli/apply.rb +9 -0
  236. data/lib/kubes/cli/base.rb +9 -0
  237. data/lib/kubes/cli/build.rb +8 -0
  238. data/lib/kubes/cli/clean.rb +9 -0
  239. data/lib/kubes/cli/compile.rb +8 -0
  240. data/lib/kubes/cli/delete.rb +11 -0
  241. data/lib/kubes/cli/deploy.rb +13 -0
  242. data/lib/kubes/cli/describe.rb +8 -0
  243. data/lib/kubes/cli/docker.rb +20 -0
  244. data/lib/kubes/cli/get.rb +8 -0
  245. data/lib/kubes/cli/help.rb +11 -0
  246. data/lib/kubes/cli/help/completion.md +20 -0
  247. data/lib/kubes/cli/help/completion_script.md +3 -0
  248. data/lib/kubes/cli/help/deploy.md +10 -0
  249. data/lib/kubes/cli/init.rb +69 -0
  250. data/lib/kubes/cli/sequence.rb +27 -0
  251. data/lib/kubes/command.rb +100 -0
  252. data/lib/kubes/compiler.rb +71 -0
  253. data/lib/kubes/compiler/decorator.rb +17 -0
  254. data/lib/kubes/compiler/decorator/base.rb +16 -0
  255. data/lib/kubes/compiler/decorator/compile.rb +12 -0
  256. data/lib/kubes/compiler/decorator/resources/base.rb +13 -0
  257. data/lib/kubes/compiler/decorator/resources/container.rb +76 -0
  258. data/lib/kubes/compiler/decorator/resources/container/mapping.rb +28 -0
  259. data/lib/kubes/compiler/decorator/resources/deployment.rb +10 -0
  260. data/lib/kubes/compiler/decorator/resources/pod.rb +10 -0
  261. data/lib/kubes/compiler/decorator/resources/secret.rb +23 -0
  262. data/lib/kubes/compiler/decorator/write.rb +14 -0
  263. data/lib/kubes/compiler/dsl/core/base.rb +27 -0
  264. data/lib/kubes/compiler/dsl/core/blocks.rb +55 -0
  265. data/lib/kubes/compiler/dsl/core/fields.rb +78 -0
  266. data/lib/kubes/compiler/dsl/core/files.rb +28 -0
  267. data/lib/kubes/compiler/dsl/core/helpers.rb +19 -0
  268. data/lib/kubes/compiler/dsl/core/parser.rb +43 -0
  269. data/lib/kubes/compiler/dsl/syntax/backend_config.rb +10 -0
  270. data/lib/kubes/compiler/dsl/syntax/cluster_role.rb +4 -0
  271. data/lib/kubes/compiler/dsl/syntax/cluster_role_binding.rb +4 -0
  272. data/lib/kubes/compiler/dsl/syntax/config_map.rb +20 -0
  273. data/lib/kubes/compiler/dsl/syntax/daemon_set.rb +23 -0
  274. data/lib/kubes/compiler/dsl/syntax/deployment.rb +160 -0
  275. data/lib/kubes/compiler/dsl/syntax/ingress.rb +41 -0
  276. data/lib/kubes/compiler/dsl/syntax/managed_certificate.rb +18 -0
  277. data/lib/kubes/compiler/dsl/syntax/namespace.rb +13 -0
  278. data/lib/kubes/compiler/dsl/syntax/network_policy.rb +47 -0
  279. data/lib/kubes/compiler/dsl/syntax/pod.rb +81 -0
  280. data/lib/kubes/compiler/dsl/syntax/resource.rb +70 -0
  281. data/lib/kubes/compiler/dsl/syntax/role.rb +40 -0
  282. data/lib/kubes/compiler/dsl/syntax/role_binding.rb +43 -0
  283. data/lib/kubes/compiler/dsl/syntax/secret.rb +22 -0
  284. data/lib/kubes/compiler/dsl/syntax/service.rb +68 -0
  285. data/lib/kubes/compiler/dsl/syntax/service_account.rb +20 -0
  286. data/lib/kubes/compiler/layering.rb +39 -0
  287. data/lib/kubes/compiler/shared/helpers.rb +31 -0
  288. data/lib/kubes/compiler/strategy.rb +27 -0
  289. data/lib/kubes/compiler/strategy/base.rb +13 -0
  290. data/lib/kubes/compiler/strategy/dsl.rb +32 -0
  291. data/lib/kubes/compiler/strategy/erb.rb +42 -0
  292. data/lib/kubes/compiler/strategy/pass.rb +9 -0
  293. data/lib/kubes/compiler/strategy/result.rb +26 -0
  294. data/lib/kubes/compiler/util/normalize.rb +11 -0
  295. data/lib/kubes/compiler/util/yaml_dump.rb +23 -0
  296. data/lib/kubes/completer.rb +159 -0
  297. data/lib/kubes/completer/script.rb +6 -0
  298. data/lib/kubes/completer/script.sh +10 -0
  299. data/lib/kubes/config.rb +82 -0
  300. data/lib/kubes/core.rb +32 -0
  301. data/lib/kubes/docker/args/default.rb +39 -0
  302. data/lib/kubes/docker/base.rb +88 -0
  303. data/lib/kubes/docker/build.rb +22 -0
  304. data/lib/kubes/docker/push.rb +33 -0
  305. data/lib/kubes/hooks/builder.rb +41 -0
  306. data/lib/kubes/hooks/dsl.rb +19 -0
  307. data/lib/kubes/kubectl.rb +87 -0
  308. data/lib/kubes/kubectl/args/base.rb +12 -0
  309. data/lib/kubes/kubectl/args/kustomize.rb +28 -0
  310. data/lib/kubes/kubectl/args/standard.rb +32 -0
  311. data/lib/kubes/kubectl/batch.rb +49 -0
  312. data/lib/kubes/kubectl/decider.rb +15 -0
  313. data/lib/kubes/kubectl/kustomize.rb +13 -0
  314. data/lib/kubes/kubectl/ordering.rb +27 -0
  315. data/lib/kubes/logger.rb +26 -0
  316. data/lib/kubes/logging.rb +7 -0
  317. data/lib/kubes/util/consider.rb +9 -0
  318. data/lib/kubes/util/sh.rb +43 -0
  319. data/lib/kubes/util/sure.rb +17 -0
  320. data/lib/kubes/util/time.rb +14 -0
  321. data/lib/kubes/version.rb +1 -1
  322. data/lib/templates/base/.kubes/config.rb.tt +9 -0
  323. data/lib/templates/base/.kubes/config/env/dev.rb +6 -0
  324. data/lib/templates/base/.kubes/config/env/prod.rb +6 -0
  325. data/lib/templates/docker/Dockerfile +4 -0
  326. data/lib/templates/dsl/.kubes/resources/base/all.rb.tt +2 -0
  327. data/lib/templates/dsl/.kubes/resources/shared/namespace.rb.tt +2 -0
  328. data/lib/templates/dsl/.kubes/resources/web/deployment.rb +10 -0
  329. data/lib/templates/dsl/.kubes/resources/web/deployment/dev.rb +1 -0
  330. data/lib/templates/dsl/.kubes/resources/web/deployment/prod.rb +1 -0
  331. data/lib/templates/dsl/.kubes/resources/web/service.rb +8 -0
  332. data/lib/templates/yaml/.kubes/resources/base/all.yaml.tt +2 -0
  333. data/lib/templates/yaml/.kubes/resources/base/deployment.yaml.tt +11 -0
  334. data/lib/templates/yaml/.kubes/resources/shared/namespace.yaml.tt +6 -0
  335. data/lib/templates/yaml/.kubes/resources/web/deployment.yaml.tt +19 -0
  336. data/lib/templates/yaml/.kubes/resources/web/deployment/dev.yaml +2 -0
  337. data/lib/templates/yaml/.kubes/resources/web/deployment/prod.yaml +2 -0
  338. data/lib/templates/yaml/.kubes/resources/web/service.yaml.tt +14 -0
  339. data/spec/cli_spec.rb +8 -0
  340. data/spec/fixtures/artifacts/demo-web/deployment.yaml +26 -0
  341. data/spec/fixtures/artifacts/demo-web/service.yaml +16 -0
  342. data/spec/fixtures/blocks/deployments.rb +9 -0
  343. data/spec/fixtures/decorators/deployment/configMap/envFrom.yaml +27 -0
  344. data/spec/fixtures/decorators/deployment/configMap/valueFrom.yaml +30 -0
  345. data/spec/fixtures/decorators/deployment/configMap/volumes.yaml +34 -0
  346. data/spec/fixtures/decorators/deployment/secret/envFrom.yaml +27 -0
  347. data/spec/fixtures/decorators/deployment/secret/valueFrom.yaml +30 -0
  348. data/spec/fixtures/decorators/deployment/secret/volumes.yaml +34 -0
  349. data/spec/fixtures/decorators/pod/configMap/envFrom.yaml +12 -0
  350. data/spec/fixtures/decorators/pod/configMap/valueFrom.yaml +16 -0
  351. data/spec/fixtures/decorators/pod/configMap/volumes.yaml +19 -0
  352. data/spec/fixtures/decorators/pod/secret/envFrom.yaml +12 -0
  353. data/spec/fixtures/decorators/pod/secret/valueFrom.yaml +16 -0
  354. data/spec/fixtures/decorators/pod/secret/volumes.yaml +19 -0
  355. data/spec/fixtures/deployments/minimum.rb +5 -0
  356. data/spec/fixtures/deployments/props.rb +7 -0
  357. data/spec/fixtures/deployments/setter/container.rb +11 -0
  358. data/spec/fixtures/deployments/setter/containers.rb +14 -0
  359. data/spec/fixtures/deployments/setter/metadata.rb +15 -0
  360. data/spec/fixtures/deployments/setter/sidecar.rb +12 -0
  361. data/spec/fixtures/deployments/setter/spec.rb +10 -0
  362. data/spec/fixtures/multiple-files/deployment-1.rb +4 -0
  363. data/spec/fixtures/multiple-files/deployment-2.rb +4 -0
  364. data/spec/fixtures/project/.gitignore +1 -0
  365. data/spec/fixtures/project/.kubes/resources/deployment.rb +32 -0
  366. data/spec/fixtures/project/.kubes/resources/foobar.rb +0 -0
  367. data/spec/fixtures/project/.kubes/resources/service.rb +3 -0
  368. data/spec/fixtures/services/minimum.rb +3 -0
  369. data/spec/fixtures/syntax/network_policy.rb +3 -0
  370. data/spec/fixtures/syntax/pod.rb +1 -0
  371. data/spec/kubes/compiler/decorator/resources/deployment_spec.rb +92 -0
  372. data/spec/kubes/compiler/decorator/resources/pod_spec.rb +92 -0
  373. data/spec/kubes/compiler/strategy/dsl_spec.rb +36 -0
  374. data/spec/kubes/compiler_spec.rb +10 -0
  375. data/spec/kubes/dsl/daemon_set.rb +11 -0
  376. data/spec/kubes/dsl/deployment_spec.rb +60 -0
  377. data/spec/kubes/dsl/network_policy_spec.rb +14 -0
  378. data/spec/kubes/dsl/pod_spec.rb +11 -0
  379. data/spec/kubes/dsl/service_spec.rb +12 -0
  380. data/spec/kubes/kubectl/batch_spec.rb +24 -0
  381. data/spec/spec_helper.rb +34 -0
  382. metadata +607 -22
  383. data/bin/console +0 -14
  384. data/bin/setup +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 59c3705e2e493cd168398c7238ed2e589db91f27
4
- data.tar.gz: 5888d3f8c498903f47cd727ce8fc5ae054b6655b
2
+ SHA256:
3
+ metadata.gz: 8d2e75bd0d156b889fcbd5a55389d335e4509e2c27bc667940bfd87155b3d9a0
4
+ data.tar.gz: f13237e1d8fa442d2b1a1ed07d7e209b3054cf3cdfee8f68dab20e3358352add
5
5
  SHA512:
6
- metadata.gz: 9a49b4005cc6a378c56d7cce1eb06ed85b5ffadf7d34a142d3bbb5ed1f4077422d3a75156e4b70e0725f6f7c6c5b1074765ab6d5179d033167ac89e81d295ad1
7
- data.tar.gz: 385c5a2869506639b415ccf701de0cd1274cd9b49f9108b7e954d5be4f0fb3c3478bd3fcdf665a7504327589161f06f8975b0c66ec0ff5a242b6ae3fcbf542c9
6
+ metadata.gz: '09576784450fc73c4846f7803c375542de5ed1f37bda86cd8cd8e61cf53dfa774192b8648d9b207180b9681a4e787ea0ade6211d02eedcd63a11051c694bb0a1'
7
+ data.tar.gz: 13219946a970eb6e476902b09971ae832b47a8cddf0ebc73ab68a079de2d7a67e50a539b8784731d67cf5037c677c811408db6e3cbb8b7eea528bec5588784a4
@@ -0,0 +1,4 @@
1
+ .git
2
+ pkg
3
+ docs
4
+ spec
data/.gitignore CHANGED
@@ -1,9 +1,17 @@
1
- /.bundle/
1
+ *.gem
2
+ *.rbc
3
+ /.bundle
4
+ /.config
2
5
  /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
+ /_yardoc
7
+ /coverage
6
8
  /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
9
+ /Gemfile.lock
10
+ /InstalledFiles
11
+ /lib/bundler/man
12
+ /pkg
13
+ /rdoc
14
+ /spec/reports
15
+ /test/tmp
16
+ /test/version_tmp
17
+ /tmp
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --require spec_helper
2
+ --color
3
+ --format documentation
@@ -0,0 +1,22 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
+
6
+ ## [0.2.4]
7
+ - #16 google cloudbuild support & docs: add Dockerfile for kubes as a docker entrypoint
8
+
9
+ ## [0.2.3]
10
+ - #15 use kubernetes default deployment strategy instead
11
+
12
+ ## [0.2.2]
13
+ - #14 init template updates, dockerfile_port helper
14
+
15
+ ## [0.2.1]
16
+ - #13 improve network policy dsl
17
+
18
+ ## [0.2.0]
19
+ - Initial release.
20
+
21
+ ## [0.1.0]
22
+ - Placeholder
@@ -0,0 +1,14 @@
1
+ FROM ruby:2.7-alpine
2
+
3
+ RUN apk add --no-cache docker
4
+ RUN apk add --no-cache build-base ruby ruby-dev
5
+
6
+ RUN wget https://storage.googleapis.com/kubernetes-release/release/v1.18.6/bin/linux/amd64/kubectl
7
+ RUN chmod u+x kubectl && mv kubectl /bin/kubectl
8
+
9
+ WORKDIR /app
10
+ ADD . /app
11
+ RUN bundle install
12
+ RUN rake install
13
+
14
+ ENTRYPOINT ["/usr/local/bundle/bin/kubes"]
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- # Specify your gem's dependencies in kubes.gemspec
3
+ # Specify your gem dependencies in kubes.gemspec
4
4
  gemspec
5
+
6
+ gem "codeclimate-test-reporter", group: :test, require: nil
@@ -0,0 +1,19 @@
1
+ guard "bundler", cmd: "bundle" do
2
+ watch("Gemfile")
3
+ watch(/^.+\.gemspec/)
4
+ end
5
+
6
+ guard :rspec, cmd: "bundle exec rspec" do
7
+ require "guard/rspec/dsl"
8
+ dsl = Guard::RSpec::Dsl.new(self)
9
+
10
+ # RSpec files
11
+ rspec = dsl.rspec
12
+ watch(rspec.spec_helper) { rspec.spec_dir }
13
+ watch(rspec.spec_support) { rspec.spec_dir }
14
+ watch(rspec.spec_files)
15
+
16
+ # Ruby files
17
+ ruby = dsl.ruby
18
+ dsl.watch_spec_files_for(ruby.lib_files)
19
+ end
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
data/README.md CHANGED
@@ -1,35 +1,63 @@
1
1
  # Kubes
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/kubes`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ [![Gem Version](https://badge.fury.io/rb/kubes.png)](http://badge.fury.io/rb/kubes)
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ [![BoltOps Badge](https://img.boltops.com/boltops/badges/boltops-badge.png)](https://www.boltops.com)
6
6
 
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
7
+ Kubernetes Deployment Tool: build docker image, compile Kubernetes YAML files, and apply them.
10
8
 
11
- ```ruby
12
- gem 'kubes'
13
- ```
9
+ Official Docs Site: [kubes.guru](https://kubes.guru)
14
10
 
15
- And then execute:
11
+ Kubes will:
16
12
 
17
- $ bundle
13
+ 1. Build the docker image and push it to repo
14
+ 2. Compile Kubernetes YAML files from YAML/ERB or a DSL and adjusts the Docker build image
15
+ 3. Deploy via kubectl apply on the compiled Kubernetes YAML files
18
16
 
19
- Or install it yourself as:
17
+ Features:
20
18
 
21
- $ gem install kubes
19
+ * Automation: [Builds the Docker image](docs/docker.md) and updates the compiled YAML files
20
+ * Syntactic Sugar: Use an optional [ERB/YAML](docs/yaml.md) or [DSL](docs/dsl.md) to write your Kubernetes YAML files. You can use a mix of DSL and YAML definitions in the `.kubes/resources` folder.
21
+ * Layering: Use the same Kubernetes YAML to build multiple environments like dev and prod with [layering](docs/layering.md).
22
+ * CLI Customizations: You can customize the [cli args](docs/kubectl.md). You can also run hooks before and after kubectl commands.
22
23
 
23
24
  ## Usage
24
25
 
25
- TODO: Write usage instructions here
26
+ kubes init # creates .kubes structure
27
+ # edit the .kubes/resources files to your needs
28
+ kubes deploy
29
+
30
+ ## How It Works
31
+
32
+ Kubes is pretty straightforward. Kubes first builds the Docker image and compiles Kubernetes YAML files. Then it merely calls `kubectl`.
33
+
34
+ In fact, you can use Kubes to build the files first, and then run `kubectl` directly. Example:
35
+
36
+ kubes docker build
37
+ kubes docker push
38
+ kubes compile # compiles the .kubes/resources files to .kubes/output
39
+
40
+ Now, use `kubectl` directly. This will apply all the files:
26
41
 
27
- ## Development
42
+ kubectl apply --recursive -f .kubes/output
28
43
 
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
44
+ You can also selectively apply specific files:
45
+
46
+ kubectl apply -f .kubes/output/web/deployment.yaml
47
+ kubectl apply -f .kubes/output/web/service.yaml
48
+
49
+ You can also apply with kubes. This will compile the automatically files also.
50
+
51
+ kubes apply
52
+
53
+ The deploy command, does all 3 steps: builds the docker image, compiles the `.kubes/resources` files, and runs kubectl apply.
54
+
55
+ kubes deploy
56
+
57
+ ## Installation
30
58
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
59
+ Install with:
32
60
 
33
- ## Contributing
61
+ gem install kubes
34
62
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/kubes.
63
+ For more info: [kubes.guru](https://kubes.guru)
data/Rakefile CHANGED
@@ -1,2 +1,14 @@
1
1
  require "bundler/gem_tasks"
2
- task :default => :spec
2
+ require "rspec/core/rake_task"
3
+
4
+ task default: :spec
5
+
6
+ RSpec::Core::RakeTask.new
7
+
8
+ require_relative "lib/kubes"
9
+ require "cli_markdown"
10
+ desc "Generates cli reference docs as markdown"
11
+ task :docs do
12
+ mkdir_p "docs/_includes"
13
+ CliMarkdown::Creator.create_all(cli_class: Kubes::CLI, cli_name: "kubes")
14
+ end
@@ -0,0 +1,5 @@
1
+ _site
2
+ .sass-cache
3
+ .jekyll-metadata
4
+ .jekyll-cache
5
+ Gemfile.lock
@@ -0,0 +1 @@
1
+ kubes.guru
@@ -0,0 +1,16 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "html-proofer"
4
+ gem "jekyll"
5
+ gem "opal"
6
+ gem "opal-browser"
7
+ gem "opal-jquery"
8
+ gem "rake"
9
+ gem "rerun"
10
+
11
+ # GitHub pages does not support this plugin.
12
+ # GitHub pages will not serve zipped assets even if we precompress them before hand.
13
+ # Leaving comment as a note:
14
+ # group :jekyll_plugins do
15
+ # gem 'jekyll-gzip'
16
+ # end
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.