uffizzi-core 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +201 -0
  3. data/README.md +52 -0
  4. data/Rakefile +31 -0
  5. data/app/assets/config/uffizzi_core_manifest.js +1 -0
  6. data/app/assets/stylesheets/uffizzi_core/application.css +15 -0
  7. data/app/clients/uffizzi_core/amazon_registry_client.rb +18 -0
  8. data/app/clients/uffizzi_core/azure_registry_client/request_result.rb +5 -0
  9. data/app/clients/uffizzi_core/azure_registry_client.rb +42 -0
  10. data/app/clients/uffizzi_core/controller_client/request_result.rb +5 -0
  11. data/app/clients/uffizzi_core/controller_client.rb +106 -0
  12. data/app/clients/uffizzi_core/docker_hub_client/request_result.rb +7 -0
  13. data/app/clients/uffizzi_core/docker_hub_client.rb +141 -0
  14. data/app/clients/uffizzi_core/github_container_registry_client/request_result.rb +7 -0
  15. data/app/clients/uffizzi_core/github_container_registry_client.rb +52 -0
  16. data/app/clients/uffizzi_core/google_registry_client/request_result.rb +5 -0
  17. data/app/clients/uffizzi_core/google_registry_client.rb +42 -0
  18. data/app/contexts/uffizzi_core/base_context.rb +12 -0
  19. data/app/contexts/uffizzi_core/project_context.rb +13 -0
  20. data/app/contexts/uffizzi_core/webhooks_context.rb +9 -0
  21. data/app/controllers/concerns/uffizzi_core/auth_management.rb +23 -0
  22. data/app/controllers/concerns/uffizzi_core/authorization_concern.rb +38 -0
  23. data/app/controllers/concerns/uffizzi_core/dependency_injection_concern.rb +19 -0
  24. data/app/controllers/uffizzi_core/api/cli/v1/account/application_controller.rb +7 -0
  25. data/app/controllers/uffizzi_core/api/cli/v1/account/credentials_controller.rb +91 -0
  26. data/app/controllers/uffizzi_core/api/cli/v1/application_controller.rb +5 -0
  27. data/app/controllers/uffizzi_core/api/cli/v1/projects/application_controller.rb +11 -0
  28. data/app/controllers/uffizzi_core/api/cli/v1/projects/compose_files_controller.rb +93 -0
  29. data/app/controllers/uffizzi_core/api/cli/v1/projects/deployments/activity_items_controller.rb +36 -0
  30. data/app/controllers/uffizzi_core/api/cli/v1/projects/deployments/application_controller.rb +7 -0
  31. data/app/controllers/uffizzi_core/api/cli/v1/projects/deployments/containers/application_controller.rb +8 -0
  32. data/app/controllers/uffizzi_core/api/cli/v1/projects/deployments/containers/logs_controller.rb +27 -0
  33. data/app/controllers/uffizzi_core/api/cli/v1/projects/deployments/containers_controller.rb +24 -0
  34. data/app/controllers/uffizzi_core/api/cli/v1/projects/deployments/events_controller.rb +29 -0
  35. data/app/controllers/uffizzi_core/api/cli/v1/projects/deployments_controller.rb +179 -0
  36. data/app/controllers/uffizzi_core/api/cli/v1/projects/secrets_controller.rb +61 -0
  37. data/app/controllers/uffizzi_core/api/cli/v1/projects_controller.rb +85 -0
  38. data/app/controllers/uffizzi_core/api/cli/v1/sessions_controller.rb +43 -0
  39. data/app/controllers/uffizzi_core/application_controller.rb +57 -0
  40. data/app/errors/uffizzi_core/compose_file/build_error.rb +4 -0
  41. data/app/errors/uffizzi_core/compose_file/credential_error.rb +4 -0
  42. data/app/errors/uffizzi_core/compose_file/parse_error.rb +4 -0
  43. data/app/errors/uffizzi_core/compose_file/secrets_error.rb +4 -0
  44. data/app/errors/uffizzi_core/deployment/image_pull_error.rb +10 -0
  45. data/app/errors/uffizzi_core/deployment_not_found_error.rb +10 -0
  46. data/app/forms/uffizzi_core/api/cli/v1/account/credential/check_credential_form.rb +16 -0
  47. data/app/forms/uffizzi_core/api/cli/v1/account/credential/create_form.rb +26 -0
  48. data/app/forms/uffizzi_core/api/cli/v1/compose_file/check_credentials_form.rb +21 -0
  49. data/app/forms/uffizzi_core/api/cli/v1/compose_file/cli_form.rb +22 -0
  50. data/app/forms/uffizzi_core/api/cli/v1/compose_file/create_form.rb +13 -0
  51. data/app/forms/uffizzi_core/api/cli/v1/compose_file/template_form.rb +44 -0
  52. data/app/forms/uffizzi_core/api/cli/v1/compose_file/update_form.rb +9 -0
  53. data/app/forms/uffizzi_core/api/cli/v1/config_file/create_form.rb +11 -0
  54. data/app/forms/uffizzi_core/api/cli/v1/deployment/create_form.rb +92 -0
  55. data/app/forms/uffizzi_core/api/cli/v1/deployment/update_form.rb +90 -0
  56. data/app/forms/uffizzi_core/api/cli/v1/project/create_form.rb +7 -0
  57. data/app/forms/uffizzi_core/api/cli/v1/project/update_form.rb +10 -0
  58. data/app/forms/uffizzi_core/api/cli/v1/secret/bulk_assign_form.rb +39 -0
  59. data/app/forms/uffizzi_core/api/cli/v1/session_create_form.rb +29 -0
  60. data/app/forms/uffizzi_core/api/cli/v1/template/create_form.rb +65 -0
  61. data/app/forms/uffizzi_core/application_form.rb +11 -0
  62. data/app/forms/uffizzi_core/application_form_without_active_record.rb +17 -0
  63. data/app/forms/uffizzi_core/mass_assignment_control_concern.rb +22 -0
  64. data/app/helpers/uffizzi_core/application_helper.rb +6 -0
  65. data/app/jobs/uffizzi_core/account/create_credential_job.rb +10 -0
  66. data/app/jobs/uffizzi_core/activity_item/docker/update_digest_job.rb +11 -0
  67. data/app/jobs/uffizzi_core/application_job.rb +7 -0
  68. data/app/jobs/uffizzi_core/config_file/apply_job.rb +31 -0
  69. data/app/jobs/uffizzi_core/credential/docker_hub/create_webhook_job.rb +15 -0
  70. data/app/jobs/uffizzi_core/deployment/create_credential_job.rb +32 -0
  71. data/app/jobs/uffizzi_core/deployment/create_credentials_job.rb +17 -0
  72. data/app/jobs/uffizzi_core/deployment/create_job.rb +15 -0
  73. data/app/jobs/uffizzi_core/deployment/create_webhooks_job.rb +13 -0
  74. data/app/jobs/uffizzi_core/deployment/delete_credential_job.rb +13 -0
  75. data/app/jobs/uffizzi_core/deployment/delete_job.rb +11 -0
  76. data/app/jobs/uffizzi_core/deployment/deploy_containers_job.rb +27 -0
  77. data/app/jobs/uffizzi_core/deployment/manage_deploy_activity_item_job.rb +38 -0
  78. data/app/lib/uffizzi_core/concerns/models/activity_item.rb +39 -0
  79. data/app/lib/uffizzi_core/concerns/models/credential.rb +65 -0
  80. data/app/lib/uffizzi_core/concerns/models/repo.rb +33 -0
  81. data/app/lib/uffizzi_core/rbac/user_access_service.rb +45 -0
  82. data/app/mailers/uffizzi_core/application_mailer.rb +8 -0
  83. data/app/models/concerns/uffizzi_core/hashid_concern.rb +25 -0
  84. data/app/models/concerns/uffizzi_core/state_machine_concern.rb +16 -0
  85. data/app/models/uffizzi_core/account.rb +83 -0
  86. data/app/models/uffizzi_core/activity_item/docker.rb +4 -0
  87. data/app/models/uffizzi_core/activity_item/github.rb +4 -0
  88. data/app/models/uffizzi_core/activity_item/memory_limit.rb +4 -0
  89. data/app/models/uffizzi_core/activity_item.rb +53 -0
  90. data/app/models/uffizzi_core/application_record.rb +7 -0
  91. data/app/models/uffizzi_core/build.rb +39 -0
  92. data/app/models/uffizzi_core/comment.rb +16 -0
  93. data/app/models/uffizzi_core/compose_file.rb +57 -0
  94. data/app/models/uffizzi_core/config_file.rb +24 -0
  95. data/app/models/uffizzi_core/container.rb +100 -0
  96. data/app/models/uffizzi_core/container_config_file.rb +8 -0
  97. data/app/models/uffizzi_core/continuous_preview.rb +4 -0
  98. data/app/models/uffizzi_core/coupon.rb +5 -0
  99. data/app/models/uffizzi_core/credential/amazon.rb +4 -0
  100. data/app/models/uffizzi_core/credential/azure.rb +4 -0
  101. data/app/models/uffizzi_core/credential/docker_hub.rb +4 -0
  102. data/app/models/uffizzi_core/credential/github.rb +4 -0
  103. data/app/models/uffizzi_core/credential/github_container_registry.rb +4 -0
  104. data/app/models/uffizzi_core/credential/google.rb +4 -0
  105. data/app/models/uffizzi_core/credential.rb +61 -0
  106. data/app/models/uffizzi_core/database.rb +4 -0
  107. data/app/models/uffizzi_core/database_offering.rb +4 -0
  108. data/app/models/uffizzi_core/deployment.rb +86 -0
  109. data/app/models/uffizzi_core/event.rb +13 -0
  110. data/app/models/uffizzi_core/invitation.rb +27 -0
  111. data/app/models/uffizzi_core/membership.rb +16 -0
  112. data/app/models/uffizzi_core/payment.rb +11 -0
  113. data/app/models/uffizzi_core/price.rb +9 -0
  114. data/app/models/uffizzi_core/product.rb +11 -0
  115. data/app/models/uffizzi_core/project.rb +67 -0
  116. data/app/models/uffizzi_core/rating.rb +20 -0
  117. data/app/models/uffizzi_core/repo/amazon.rb +4 -0
  118. data/app/models/uffizzi_core/repo/azure.rb +4 -0
  119. data/app/models/uffizzi_core/repo/docker_hub.rb +4 -0
  120. data/app/models/uffizzi_core/repo/github.rb +4 -0
  121. data/app/models/uffizzi_core/repo/github_container_registry.rb +4 -0
  122. data/app/models/uffizzi_core/repo/google.rb +4 -0
  123. data/app/models/uffizzi_core/repo.rb +29 -0
  124. data/app/models/uffizzi_core/role.rb +17 -0
  125. data/app/models/uffizzi_core/secret.rb +9 -0
  126. data/app/models/uffizzi_core/template.rb +19 -0
  127. data/app/models/uffizzi_core/user.rb +62 -0
  128. data/app/models/uffizzi_core/user_project.rb +14 -0
  129. data/app/policies/uffizzi_core/api/cli/v1/account/credentials_policy.rb +19 -0
  130. data/app/policies/uffizzi_core/api/cli/v1/projects/compose_files_policy.rb +15 -0
  131. data/app/policies/uffizzi_core/api/cli/v1/projects/deployments/activity_items_policy.rb +7 -0
  132. data/app/policies/uffizzi_core/api/cli/v1/projects/deployments/containers_policy.rb +7 -0
  133. data/app/policies/uffizzi_core/api/cli/v1/projects/deployments/events_policy.rb +7 -0
  134. data/app/policies/uffizzi_core/api/cli/v1/projects/deployments_policy.rb +27 -0
  135. data/app/policies/uffizzi_core/api/cli/v1/projects/secrets_policy.rb +15 -0
  136. data/app/policies/uffizzi_core/api/cli/v1/projects_policy.rb +19 -0
  137. data/app/policies/uffizzi_core/application_policy.rb +12 -0
  138. data/app/repositories/uffizzi_core/activity_item_repo.rb +9 -0
  139. data/app/repositories/uffizzi_core/basic_order_repo.rb +11 -0
  140. data/app/repositories/uffizzi_core/build_repo.rb +23 -0
  141. data/app/repositories/uffizzi_core/comment_repo.rb +11 -0
  142. data/app/repositories/uffizzi_core/compose_file_repo.rb +11 -0
  143. data/app/repositories/uffizzi_core/config_file_repo.rb +40 -0
  144. data/app/repositories/uffizzi_core/container_repo.rb +25 -0
  145. data/app/repositories/uffizzi_core/credential_repo.rb +31 -0
  146. data/app/repositories/uffizzi_core/deployment_repo.rb +24 -0
  147. data/app/repositories/uffizzi_core/event_repo.rb +9 -0
  148. data/app/repositories/uffizzi_core/membership_repo.rb +10 -0
  149. data/app/repositories/uffizzi_core/price_repo.rb +11 -0
  150. data/app/repositories/uffizzi_core/product_repo.rb +11 -0
  151. data/app/repositories/uffizzi_core/project_repo.rb +10 -0
  152. data/app/repositories/uffizzi_core/repo_repo.rb +10 -0
  153. data/app/repositories/uffizzi_core/template_repo.rb +87 -0
  154. data/app/repositories/uffizzi_core/usage_repo.rb +9 -0
  155. data/app/repositories/uffizzi_core/user_repo.rb +11 -0
  156. data/app/responders/uffizzi_core/json_responder.rb +13 -0
  157. data/app/serializers/uffizzi_core/api/cli/v1/account/credential_serializer.rb +9 -0
  158. data/app/serializers/uffizzi_core/api/cli/v1/project_serializer/compose_file_serializer.rb +7 -0
  159. data/app/serializers/uffizzi_core/api/cli/v1/project_serializer/deployment_serializer.rb +13 -0
  160. data/app/serializers/uffizzi_core/api/cli/v1/project_serializer.rb +30 -0
  161. data/app/serializers/uffizzi_core/api/cli/v1/projects/compose_file_serializer.rb +7 -0
  162. data/app/serializers/uffizzi_core/api/cli/v1/projects/deployment_serializer/container_serializer.rb +32 -0
  163. data/app/serializers/uffizzi_core/api/cli/v1/projects/deployment_serializer/user_serializer.rb +11 -0
  164. data/app/serializers/uffizzi_core/api/cli/v1/projects/deployment_serializer.rb +74 -0
  165. data/app/serializers/uffizzi_core/api/cli/v1/projects/deployments/activity_item_serializer.rb +24 -0
  166. data/app/serializers/uffizzi_core/api/cli/v1/projects/deployments/container_serializer/container_config_file_serializer/config_file_serializer.rb +6 -0
  167. data/app/serializers/uffizzi_core/api/cli/v1/projects/deployments/container_serializer/container_config_file_serializer.rb +7 -0
  168. data/app/serializers/uffizzi_core/api/cli/v1/projects/deployments/container_serializer.rb +30 -0
  169. data/app/serializers/uffizzi_core/api/cli/v1/projects/secret_serializer.rb +5 -0
  170. data/app/serializers/uffizzi_core/api/cli/v1/short_project_serializer.rb +7 -0
  171. data/app/serializers/uffizzi_core/api/cli/v1/user_serializer/account_serializer.rb +5 -0
  172. data/app/serializers/uffizzi_core/api/cli/v1/user_serializer.rb +7 -0
  173. data/app/serializers/uffizzi_core/base_serializer.rb +7 -0
  174. data/app/serializers/uffizzi_core/controller/apply_config_file/config_file_serializer.rb +5 -0
  175. data/app/serializers/uffizzi_core/controller/create_credential/credential_serializer.rb +19 -0
  176. data/app/serializers/uffizzi_core/controller/create_deployment/deployment_serializer.rb +5 -0
  177. data/app/serializers/uffizzi_core/controller/deploy_containers/container_serializer/container_config_file_serializer/config_file_serializer.rb +8 -0
  178. data/app/serializers/uffizzi_core/controller/deploy_containers/container_serializer/container_config_file_serializer.rb +7 -0
  179. data/app/serializers/uffizzi_core/controller/deploy_containers/container_serializer.rb +70 -0
  180. data/app/serializers/uffizzi_core/controller/deploy_containers/credential_serializer.rb +5 -0
  181. data/app/services/uffizzi_core/account_service.rb +21 -0
  182. data/app/services/uffizzi_core/activity_item_service.rb +88 -0
  183. data/app/services/uffizzi_core/amazon/credential_service.rb +31 -0
  184. data/app/services/uffizzi_core/amazon_service.rb +45 -0
  185. data/app/services/uffizzi_core/azure/credential_service.rb +18 -0
  186. data/app/services/uffizzi_core/compose_file/builders/config_files_builder_service.rb +31 -0
  187. data/app/services/uffizzi_core/compose_file/builders/container_builder_service.rb +222 -0
  188. data/app/services/uffizzi_core/compose_file/builders/docker_repo_builder_service.rb +25 -0
  189. data/app/services/uffizzi_core/compose_file/builders/template_builder_service.rb +45 -0
  190. data/app/services/uffizzi_core/compose_file/builders/variables_builder_service.rb +58 -0
  191. data/app/services/uffizzi_core/compose_file/config_files_service.rb +52 -0
  192. data/app/services/uffizzi_core/compose_file/config_option_service.rb +41 -0
  193. data/app/services/uffizzi_core/compose_file/configs_options_service.rb +26 -0
  194. data/app/services/uffizzi_core/compose_file/container_service.rb +68 -0
  195. data/app/services/uffizzi_core/compose_file/continuous_preview_options_service.rb +57 -0
  196. data/app/services/uffizzi_core/compose_file/dependencies_service.rb +56 -0
  197. data/app/services/uffizzi_core/compose_file/errors_service.rb +46 -0
  198. data/app/services/uffizzi_core/compose_file/github_dependencies_service.rb +38 -0
  199. data/app/services/uffizzi_core/compose_file/ingress_options_service.rb +51 -0
  200. data/app/services/uffizzi_core/compose_file/parsers/services/healthcheck_parser_service.rb +73 -0
  201. data/app/services/uffizzi_core/compose_file/secrets_options_service.rb +28 -0
  202. data/app/services/uffizzi_core/compose_file/services_options/command_service.rb +18 -0
  203. data/app/services/uffizzi_core/compose_file/services_options/configs_service.rb +51 -0
  204. data/app/services/uffizzi_core/compose_file/services_options/deploy_service.rb +44 -0
  205. data/app/services/uffizzi_core/compose_file/services_options/entrypoint_service.rb +18 -0
  206. data/app/services/uffizzi_core/compose_file/services_options/env_file_service.rb +34 -0
  207. data/app/services/uffizzi_core/compose_file/services_options/environment_service.rb +20 -0
  208. data/app/services/uffizzi_core/compose_file/services_options/image_service.rb +89 -0
  209. data/app/services/uffizzi_core/compose_file/services_options/secrets_service.rb +35 -0
  210. data/app/services/uffizzi_core/compose_file/services_options_service.rb +57 -0
  211. data/app/services/uffizzi_core/compose_file/template_service.rb +55 -0
  212. data/app/services/uffizzi_core/compose_file/variables_service.rb +25 -0
  213. data/app/services/uffizzi_core/compose_file_service.rb +181 -0
  214. data/app/services/uffizzi_core/container_service.rb +42 -0
  215. data/app/services/uffizzi_core/controller_service.rb +86 -0
  216. data/app/services/uffizzi_core/credential_service.rb +44 -0
  217. data/app/services/uffizzi_core/deployment_service.rb +307 -0
  218. data/app/services/uffizzi_core/docker_hub/credential_service.rb +15 -0
  219. data/app/services/uffizzi_core/docker_hub_service.rb +77 -0
  220. data/app/services/uffizzi_core/github_container_registry/credential_service.rb +24 -0
  221. data/app/services/uffizzi_core/google/credential_service.rb +18 -0
  222. data/app/services/uffizzi_core/logs_service.rb +33 -0
  223. data/app/services/uffizzi_core/manage_activity_items_service.rb +159 -0
  224. data/app/services/uffizzi_core/project_service.rb +48 -0
  225. data/app/services/uffizzi_core/repo_service.rb +43 -0
  226. data/app/services/uffizzi_core/response_service.rb +13 -0
  227. data/app/services/uffizzi_core/starter_template_service.rb +200 -0
  228. data/app/services/uffizzi_core/template_service.rb +21 -0
  229. data/app/services/uffizzi_core/token_service.rb +19 -0
  230. data/app/services/uffizzi_core/user_access_service.rb +14 -0
  231. data/app/services/uffizzi_core/user_generator_service.rb +84 -0
  232. data/app/utils/uffizzi_core/converters.rb +33 -0
  233. data/app/validators/uffizzi_core/email_validator.rb +9 -0
  234. data/app/validators/uffizzi_core/environment_variable_list_validator.rb +15 -0
  235. data/app/validators/uffizzi_core/image_command_args_validator.rb +21 -0
  236. data/config/initializers/rswag_api.rb +15 -0
  237. data/config/initializers/rswag_ui.rb +15 -0
  238. data/config/initializers/swagger_yard.rb +17 -0
  239. data/config/locales/en.activerecord.yml +23 -0
  240. data/config/locales/en.yml +66 -0
  241. data/config/routes.rb +69 -0
  242. data/db/migrate/20220218121438_create_uffizzi_core_tables.rb +375 -0
  243. data/db/migrate/20220309110201_remove_secrets_from_projects.rb +7 -0
  244. data/db/migrate/20220310110150_create_project_secrets.rb +14 -0
  245. data/db/migrate/20220325113342_add_name_to_uffizzi_containers.rb +7 -0
  246. data/db/migrate/20220329123323_rename_project_secrets_to_secrets.rb +7 -0
  247. data/db/migrate/20220329124542_add_resource_to_secrets.rb +7 -0
  248. data/db/migrate/20220329143241_remove_project_ref_from_secrets.rb +7 -0
  249. data/db/migrate/20220419074956_add_health_check_to_containers.rb +7 -0
  250. data/db/migrate/20220525113412_rename_name_to_uffizzi_containers.rb +7 -0
  251. data/db/seeds.rb +16 -0
  252. data/lib/tasks/uffizzi_core_tasks.rake +19 -0
  253. data/lib/uffizzi_core/engine.rb +15 -0
  254. data/lib/uffizzi_core/version.rb +5 -0
  255. data/lib/uffizzi_core.rb +61 -0
  256. data/swagger/v1/swagger.json +1659 -0
  257. metadata +966 -0
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ Rswag::Api.configure do |c|
4
+ # Specify a root folder where Swagger JSON files are located
5
+ # This is used by the Swagger middleware to serve requests for API descriptions
6
+ # NOTE: If you're using rswag-specs to generate Swagger, you'll need to ensure
7
+ # that it's configured to generate files in the same folder
8
+ c.swagger_root = "#{UffizziCore::Engine.root}/swagger"
9
+
10
+ # Inject a lamda function to alter the returned Swagger prior to serialization
11
+ # The function will have access to the rack env for the current request
12
+ # For example, you could leverage this to dynamically assign the "host" property
13
+ #
14
+ # c.swagger_filter = lambda { |swagger, env| swagger['host'] = env['HTTP_HOST'] }
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ Rswag::Ui.configure do |c|
4
+ # List the Swagger endpoints that you want to be documented through the swagger-ui
5
+ # The first parameter is the path (absolute or relative to the UI host) to the corresponding
6
+ # endpoint and the second is a title that will be displayed in the document selector
7
+ # NOTE: If you're using rspec-api to expose Swagger files (under swagger_root) as JSON or YAML endpoints,
8
+ # then the list below should correspond to the relative paths for those endpoints
9
+
10
+ c.swagger_endpoint('/api-docs/v1/swagger.json', 'API V1 Docs')
11
+
12
+ # Add Basic Auth in case your API is private
13
+ # c.basic_auth_enabled = true
14
+ # c.basic_auth_credentials 'username', 'password'
15
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'swagger_yard'
4
+
5
+ SwaggerYard.configure do |config|
6
+ config.api_version = '1.0'
7
+
8
+ config.title = 'Uffizzi docs'
9
+ config.description = 'Your API does this'
10
+
11
+ config.api_base_path = 'http://lvh.me:7000'
12
+
13
+ config.controller_path = File.expand_path('app/controllers/uffizzi_core/api/**/*', UffizziCore::Engine.root)
14
+ config.model_path = File.expand_path('app/models/uffizzi_core/**/*', UffizziCore::Engine.root)
15
+
16
+ config.include_private = false
17
+ end
@@ -0,0 +1,23 @@
1
+ en:
2
+ activerecord:
3
+ errors:
4
+ models:
5
+ uffizzi_core/project:
6
+ attributes:
7
+ secret:
8
+ not_found: There is no secret with name %{name}
9
+ uffizzi_core/credential:
10
+ attributes:
11
+ registry_url:
12
+ invalid_scheme: The protocol for the registry url is not specified
13
+ password:
14
+ password_blank: Password/Access Token can't be blank
15
+ username:
16
+ incorrect: We were unable to log you in to docker registry. Please verify that your username and password are correct.
17
+ type:
18
+ exist: Credential of that type already exist.
19
+ uffizzi_core/deployment:
20
+ attributes:
21
+ containers:
22
+ max_memory_limit_error: 'Memory limit of containers must be less than %{max}'
23
+ max_memory_request_error: 'Memory request of containers must be less than %{max}'
@@ -0,0 +1,66 @@
1
+ en:
2
+ github:
3
+ preview_url_message: |
4
+ **This branch has been deployed using Uffizzi.**
5
+ Preview URL:
6
+ https://%{preview_url}
7
+ View deployment details here:
8
+ https://%{deployment_url}
9
+ This is an automated comment. To turn off commenting, visit uffizzi.com.
10
+ invalid_compose_message: |
11
+ :exclamation: **Preview failed: invalid compose**
12
+        Uffizzi was unable to deploy a preview of this pull request because the compose file in this branch is invalid.
13
+ compose:
14
+ unsupported_file: Unsupported compose file
15
+ invalid_file: Invalid compose file
16
+ invalid_config_option: Invalid config option '%{value}' - only [a-zA-Z0-9\._\-] characters are allowed
17
+ no_services: Service services has neither an image nor a build context specified. At least one must be provided.
18
+ no_ingress: Service ingress has not been defined.
19
+ invalid_image_value: Invalid image value '%{value}'
20
+ invalid_credential: Invalid credential '%{value}'
21
+ invalid_repo_type: Unsupported repo type
22
+ repo_not_found: The specified repository doesn't exist '%{name}'
23
+ ingress_port_not_specified: Ingress port not specified
24
+ ingress_service_not_found: Ingress service not found
25
+ invalid_ingress_service: Invalid ingress service '%{value}'
26
+ no_variable_name: Invalid environment variable 'name=%{name}' 'value=%{value}'
27
+ invalid_config: Invalid config value 'source=%{source}' 'target=%{target}'
28
+ port_out_of_range: Port should be specified between %{port_min} - %{port_max}
29
+ invalid_memory_postfix: The specified value for memory '%{value}' should specify the units. The postfix should be one of the `b` `k` `m` `g` characters
30
+ invalid_memory_type: Memory '%{value}' contains an invalid type, it should be a string
31
+ invalid_memory_value: Invalid memory value '%{value}'
32
+ invalid_memory: The memory should be one of the `125m` `250m` `500m` `1000m` `2000m` `4000m` values
33
+ image_build_no_specified: Service %{value} has neither an image nor a build context specified. At least one must be provided.
34
+ build_context_no_specified: The context option should be specified
35
+ config_file_not_found: Config file not found '%{name}'
36
+ invalid_context: Invalid context value '%{value}'
37
+ invalid_bool_value: Invalid %{field} value '%{value}'. The value should be `true` or `false`
38
+ invalid_delete_after_postfix: The postfix of the delete_preview_after value should be `h`
39
+ invalid_integer: The specified value for %{option} should be an Integer type
40
+ invalid_string: The specified value for %{option} should be a String type
41
+ invalid_delete_after_min: Minimum delete_preview_after allowed is %{value}h
42
+ invalid_delete_after_max: Maximum delete_preview_after allowed is %{value}h
43
+ invalid_type: Unsupported type of '%{option}' option
44
+ empty_env_file: env_file contains an empty value
45
+ file_not_found: Couldn't find '%{path}' file
46
+ env_file_duplicates: env_file contains non-unique items '%{values}'
47
+ boolean_option: The service name %{value} must be a quoted string, i.e. '%{value}'.
48
+ config_file_option_empty: "'%{config_name}' has an empty file"
49
+ global_config_not_found: undefined config '%{config}'
50
+ invalid_branch: Branch '%{branch}' doesn't exist for repository '%{repository_url}'
51
+ repository_not_found: The specified repository doesn't exist '%{repository_url}'
52
+ build_context_unknown_repository: Compose repository is undefined
53
+ secret_name_blank: The specified name for '%{option}' secret can not be blank
54
+ secret_external: The specified secret '%{secret}' should be external
55
+ global_secret_not_found: undefined secret '%{secret}'
56
+ project_secret_not_found: Project secret '%{secret}' not found
57
+ continuous_preview_in_service_level: The option '%{option}' is not supported for service-level. Use 'x-uffizzi-continuous-preview' instead
58
+ file_already_exists: A compose file already exists for this project. Run 'uffizzi compose update' to update this file or 'uffizzi compose rm' to remove it. For more options, see 'uffizzi compose --help'
59
+ invalid_healthcheck_command: "Service '%{name}' defines an invalid healthcheck: when 'test' is a list the first item must be either NONE, CMD or CMD-SHELL"
60
+ invalid_time_interval: The time interval should be in the following format '{hours}h{minutes}m{seconds}s'. At least one value must be present.
61
+ string_or_array_error: "'%{option}' contains an invalid type, it should be a string, or an array"
62
+ not_implemented: "'%{option}' option is not implemented"
63
+ infinite_recursion: "Found infinite recursion for key '%{key}'"
64
+ secrets:
65
+ duplicates_exists: Secret with key %{secrets} already exist.
66
+ invalid_key_length: A secret key must be no longer than 256 characters.
data/config/routes.rb ADDED
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ UffizziCore::Engine.routes.draw do
4
+ mount Rswag::Api::Engine => '/api-docs'
5
+ mount Rswag::Ui::Engine => '/api-docs'
6
+
7
+ namespace :api, defaults: { format: :json } do
8
+ namespace :cli do
9
+ namespace :v1 do
10
+ resource :webhooks, only: [] do
11
+ post :docker_hub
12
+ post :github
13
+ post :azure
14
+ post :amazon
15
+ post :google
16
+ end
17
+
18
+ resources :projects, only: ['index', 'show', 'create', 'destroy'], param: :slug do
19
+ scope module: :projects do
20
+ resource :compose_file, only: ['show', 'create', 'destroy']
21
+ resources :deployments, only: ['index', 'show', 'create', 'destroy', 'update'] do
22
+ post :deploy_containers, on: :member
23
+ scope module: :deployments do
24
+ resources :activity_items, only: ['index']
25
+ resources :containers, only: ['index'], param: :name do
26
+ scope module: :containers do
27
+ resources :logs, only: ['index']
28
+ resources :builds, only: [] do
29
+ collection do
30
+ get :logs
31
+ end
32
+ end
33
+ end
34
+ end
35
+ resources :events, only: ['index']
36
+ resources :containers, only: ['index'], param: :name do
37
+ scope module: :containers do
38
+ resources :logs, only: ['index']
39
+ resources :builds, only: [] do
40
+ collection do
41
+ get :logs
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ resources :secrets, only: ['index', 'destroy'] do
49
+ collection do
50
+ post :bulk_create
51
+ end
52
+ end
53
+ end
54
+ end
55
+ resource :session, only: ['create', 'destroy']
56
+
57
+ resource :account, only: [] do
58
+ scope module: :account do
59
+ resources :credentials, only: ['index', 'create', 'destroy'], param: :type do
60
+ member do
61
+ get :check_credential
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,375 @@
1
+ # frozen_string_literal: true
2
+
3
+ class CreateUffizziCoreTables < ActiveRecord::Migration[6.1]
4
+ def change
5
+ create_table('uffizzi_core_accounts', force: :cascade) do |t|
6
+ t.text('name')
7
+ t.text('kind', null: false)
8
+ t.datetime('created_at', precision: 6, null: false)
9
+ t.datetime('updated_at', precision: 6, null: false)
10
+ t.string('customer_token')
11
+ t.string('state')
12
+ t.string('subscription_token')
13
+ t.datetime('payment_issue_at')
14
+ t.string('domain')
15
+ t.boolean('sso_enabled', default: false)
16
+ t.bigint('owner_id')
17
+ t.integer('container_memory_limit')
18
+ t.string('workos_organization_id')
19
+ t.string('sso_state')
20
+ t.index(['customer_token'], name: 'index_accounts_on_customer_token', unique: true)
21
+ t.index(['domain'], name: 'index_accounts_on_domain', unique: true)
22
+ t.index(['subscription_token'], name: 'index_accounts_on_subscription_token', unique: true)
23
+ end
24
+
25
+ create_table('uffizzi_core_activity_items', force: :cascade) do |t|
26
+ t.bigint('deployment_id', null: false)
27
+ t.string('namespace')
28
+ t.string('name')
29
+ t.string('tag')
30
+ t.string('branch')
31
+ t.string('type')
32
+ t.bigint('container_id', null: false)
33
+ t.string('commit')
34
+ t.string('commit_message')
35
+ t.bigint('build_id')
36
+ t.datetime('created_at', precision: 6, null: false)
37
+ t.datetime('updated_at', precision: 6, null: false)
38
+ t.jsonb('data', default: {}, null: false)
39
+ t.string('digest')
40
+ t.index(['container_id'], name: 'index_activity_items_on_container_id')
41
+ t.index(['deployment_id'], name: 'index_activity_items_on_deployment_id')
42
+ end
43
+
44
+ create_table('uffizzi_core_builds', force: :cascade) do |t|
45
+ t.bigint('repo_id', null: false)
46
+ t.string('build_id')
47
+ t.string('repository')
48
+ t.string('branch')
49
+ t.string('commit')
50
+ t.string('committer')
51
+ t.string('message')
52
+ t.string('log_url')
53
+ t.integer('status')
54
+ t.datetime('started_at')
55
+ t.datetime('ended_at')
56
+ t.datetime('created_at', precision: 6, null: false)
57
+ t.datetime('updated_at', precision: 6, null: false)
58
+ t.boolean('deployed')
59
+ t.index(['build_id'], name: 'index_builds_on_build_id', unique: true)
60
+ t.index(['repo_id'], name: 'index_builds_on_repo_id')
61
+ end
62
+
63
+ create_table('uffizzi_core_comments', force: :cascade) do |t|
64
+ t.string('commentable_type')
65
+ t.bigint('commentable_id')
66
+ t.text('content')
67
+ t.bigint('user_id', null: false)
68
+ t.datetime('created_at', precision: 6, null: false)
69
+ t.datetime('updated_at', precision: 6, null: false)
70
+ t.string('ancestry')
71
+ t.integer('ancestry_depth', default: 0)
72
+ t.index(['ancestry'], name: 'index_comments_on_ancestry')
73
+ t.index(['commentable_type', 'commentable_id'], name: 'index_comments_on_commentable')
74
+ t.index(['user_id'], name: 'index_comments_on_user_id')
75
+ end
76
+
77
+ create_table('uffizzi_core_compose_files', force: :cascade) do |t|
78
+ t.string('source')
79
+ t.bigint('repository_id')
80
+ t.string('branch')
81
+ t.string('path')
82
+ t.string('auto_deploy')
83
+ t.bigint('added_by_id')
84
+ t.bigint('project_id', null: false)
85
+ t.datetime('created_at', precision: 6, null: false)
86
+ t.datetime('updated_at', precision: 6, null: false)
87
+ t.string('state')
88
+ t.jsonb('payload', default: {}, null: false)
89
+ t.text('content')
90
+ t.string('kind', default: 'main')
91
+ t.index(['project_id'], name: 'index_compose_files_on_project_id')
92
+ end
93
+
94
+ create_table('uffizzi_core_config_files', force: :cascade) do |t|
95
+ t.string('filename')
96
+ t.string('kind')
97
+ t.bigint('added_by_id')
98
+ t.text('payload')
99
+ t.bigint('project_id', null: false)
100
+ t.datetime('created_at', precision: 6, null: false)
101
+ t.datetime('updated_at', precision: 6, null: false)
102
+ t.bigint('compose_file_id')
103
+ t.string('creation_source')
104
+ t.string('source')
105
+ t.index(['compose_file_id'], name: 'index_config_files_on_compose_file_id')
106
+ t.index(['project_id'], name: 'index_config_files_on_project_id')
107
+ end
108
+
109
+ create_table('uffizzi_core_container_config_files', force: :cascade) do |t|
110
+ t.string('mount_path')
111
+ t.bigint('container_id', null: false)
112
+ t.bigint('config_file_id', null: false)
113
+ t.datetime('created_at', precision: 6, null: false)
114
+ t.datetime('updated_at', precision: 6, null: false)
115
+ t.index(['config_file_id'], name: 'index_container_config_files_on_config_file_id')
116
+ t.index(['container_id'], name: 'index_container_config_files_on_container_id')
117
+ end
118
+
119
+ create_table('uffizzi_core_containers', force: :cascade) do |t|
120
+ t.string('image')
121
+ t.string('tag')
122
+ t.jsonb('variables')
123
+ t.datetime('created_at', precision: 6, null: false)
124
+ t.datetime('updated_at', precision: 6, null: false)
125
+ t.bigint('deployment_id')
126
+ t.boolean('public', default: false, null: false)
127
+ t.integer('port')
128
+ t.bigint('repo_id')
129
+ t.string('state')
130
+ t.string('continuously_deploy', null: false)
131
+ t.string('kind', default: 'user')
132
+ t.integer('target_port')
133
+ t.string('controller_name')
134
+ t.boolean('receive_incoming_requests')
135
+ t.integer('memory_request')
136
+ t.integer('memory_limit')
137
+ t.jsonb('secret_variables')
138
+ t.string('entrypoint')
139
+ t.string('command')
140
+ t.index(['deployment_id'], name: 'index_containers_on_deployment_id')
141
+ t.index(['repo_id'], name: 'index_containers_on_repo_id')
142
+ end
143
+
144
+ create_table('uffizzi_core_coupons', force: :cascade) do |t|
145
+ t.string('token')
146
+ t.string('name', null: false)
147
+ t.string('currency', null: false)
148
+ t.bigint('amount_off', null: false)
149
+ t.string('duration', null: false)
150
+ t.datetime('created_at', precision: 6, null: false)
151
+ t.datetime('updated_at', precision: 6, null: false)
152
+ end
153
+
154
+ create_table('uffizzi_core_credentials', force: :cascade) do |t|
155
+ t.string('type')
156
+ t.string('username')
157
+ t.string('password')
158
+ t.bigint('project_id')
159
+ t.datetime('created_at', precision: 6, null: false)
160
+ t.datetime('updated_at', precision: 6, null: false)
161
+ t.string('provider_ref')
162
+ t.bigint('account_id')
163
+ t.string('state')
164
+ t.string('registry_url')
165
+ t.index(['account_id'], name: 'index_credentials_on_account_id')
166
+ t.index(['project_id'], name: 'index_credentials_on_project_id')
167
+ t.index(['provider_ref'], name: 'index_credentials_on_provider_ref')
168
+ end
169
+
170
+ create_table('uffizzi_core_deployments', force: :cascade) do |t|
171
+ t.bigint('project_id', null: false)
172
+ t.text('kind', null: false)
173
+ t.datetime('created_at', precision: 6, null: false)
174
+ t.datetime('updated_at', precision: 6, null: false)
175
+ t.string('creator_name')
176
+ t.string('subdomain')
177
+ t.string('state')
178
+ t.float('memory_limit')
179
+ t.bigint('deployed_by_id')
180
+ t.bigint('continuous_preview_id_deprecated')
181
+ t.jsonb('continuous_preview_payload')
182
+ t.string('creation_source')
183
+ t.bigint('compose_file_id')
184
+ t.bigint('template_id')
185
+ t.index(['compose_file_id'], name: 'index_deployments_on_compose_file_id')
186
+ t.index(['project_id'], name: 'index_deployments_on_project_id')
187
+ t.index(['template_id'], name: 'index_deployments_on_template_id')
188
+ end
189
+
190
+ create_table('uffizzi_core_events', force: :cascade) do |t|
191
+ t.bigint('activity_item_id', null: false)
192
+ t.string('state')
193
+ t.datetime('created_at', precision: 6, null: false)
194
+ t.datetime('updated_at', precision: 6, null: false)
195
+ t.index(['activity_item_id'], name: 'index_events_on_activity_item_id')
196
+ end
197
+
198
+ create_table('uffizzi_core_invitations', force: :cascade) do |t|
199
+ t.text('email', null: false)
200
+ t.text('token', null: false)
201
+ t.string('status', null: false)
202
+ t.datetime('created_at', precision: 6, null: false)
203
+ t.datetime('updated_at', precision: 6, null: false)
204
+ t.bigint('invited_by_id', null: false)
205
+ t.bigint('entityable_id', null: false)
206
+ t.string('entityable_type', null: false)
207
+ t.string('role', null: false)
208
+ t.bigint('invitee_id')
209
+ t.index(['token'], name: 'index_invitations_on_token', unique: true)
210
+ end
211
+
212
+ create_table('uffizzi_core_memberships', force: :cascade) do |t|
213
+ t.bigint('user_id', null: false)
214
+ t.bigint('account_id', null: false)
215
+ t.text('role', null: false)
216
+ t.datetime('created_at', precision: 6, null: false)
217
+ t.datetime('updated_at', precision: 6, null: false)
218
+ t.index(['account_id'], name: 'index_memberships_on_account_id')
219
+ t.index(['user_id', 'account_id'], name: 'index_memberships_on_user_id_and_account_id')
220
+ t.index(['user_id'], name: 'index_memberships_on_user_id')
221
+ end
222
+
223
+ create_table('uffizzi_core_payments', force: :cascade) do |t|
224
+ t.bigint('account_id', null: false)
225
+ t.string('charge_id')
226
+ t.string('status')
227
+ t.float('amount')
228
+ t.datetime('created_at', precision: 6, null: false)
229
+ t.datetime('updated_at', precision: 6, null: false)
230
+ t.index(['account_id'], name: 'index_payments_on_account_id')
231
+ end
232
+
233
+ create_table('uffizzi_core_prices', force: :cascade) do |t|
234
+ t.string('token')
235
+ t.string('slug', null: false)
236
+ t.string('name', null: false)
237
+ t.float('units_price', null: false)
238
+ t.bigint('units_amount', null: false)
239
+ t.bigint('product_id', null: false)
240
+ t.datetime('created_at', precision: 6, null: false)
241
+ t.datetime('updated_at', precision: 6, null: false)
242
+ t.index(['product_id'], name: 'index_prices_on_product_id')
243
+ end
244
+
245
+ create_table('uffizzi_core_products', force: :cascade) do |t|
246
+ t.string('token')
247
+ t.string('slug', null: false)
248
+ t.string('name', null: false)
249
+ t.string('type', null: false)
250
+ t.datetime('created_at', precision: 6, null: false)
251
+ t.datetime('updated_at', precision: 6, null: false)
252
+ t.string('kind')
253
+ end
254
+
255
+ create_table('uffizzi_core_projects', force: :cascade) do |t|
256
+ t.text('name', null: false)
257
+ t.datetime('created_at', precision: 6, null: false)
258
+ t.datetime('updated_at', precision: 6, null: false)
259
+ t.bigint('account_id', null: false)
260
+ t.string('state')
261
+ t.string('slug')
262
+ t.string('description')
263
+ t.jsonb('secrets')
264
+ t.index(['account_id', 'name'], name: 'index_projects_on_account_id_and_name', unique: true)
265
+ t.index(['account_id'], name: 'index_projects_on_account_id')
266
+ end
267
+
268
+ create_table('uffizzi_core_ratings', force: :cascade) do |t|
269
+ t.string('name')
270
+ t.string('state')
271
+ t.datetime('created_at', precision: 6, null: false)
272
+ t.datetime('updated_at', precision: 6, null: false)
273
+ end
274
+
275
+ create_table('uffizzi_core_repos', force: :cascade) do |t|
276
+ t.string('namespace')
277
+ t.string('name')
278
+ t.string('tag')
279
+ t.string('type')
280
+ t.string('branch')
281
+ t.bigint('project_id', null: false)
282
+ t.datetime('created_at', precision: 6, null: false)
283
+ t.datetime('updated_at', precision: 6, null: false)
284
+ t.string('description')
285
+ t.boolean('is_private')
286
+ t.string('slug')
287
+ t.bigint('repository_id')
288
+ t.string('kind')
289
+ t.string('dockerfile_path')
290
+ t.jsonb('args')
291
+ t.string('dockerfile_context_path')
292
+ t.boolean('deploy_preview_when_pull_request_is_opened')
293
+ t.boolean('delete_preview_when_pull_request_is_closed')
294
+ t.boolean('deploy_preview_when_image_tag_is_created')
295
+ t.boolean('delete_preview_when_image_tag_is_updated')
296
+ t.boolean('share_to_github')
297
+ t.integer('delete_preview_after')
298
+ t.string('tag_pattern_deprecated')
299
+ t.index(['project_id'], name: 'index_repos_on_project_id')
300
+ end
301
+
302
+ create_table('uffizzi_core_roles', force: :cascade) do |t|
303
+ t.string('name')
304
+ t.string('resource_type')
305
+ t.bigint('resource_id')
306
+ t.datetime('created_at', precision: 6, null: false)
307
+ t.datetime('updated_at', precision: 6, null: false)
308
+ t.index(['name', 'resource_type', 'resource_id'], name: 'index_roles_on_name_and_resource_type_and_resource_id')
309
+ t.index(['resource_type', 'resource_id'], name: 'index_roles_on_resource_type_and_resource_id')
310
+ end
311
+
312
+ create_table('uffizzi_core_templates', force: :cascade) do |t|
313
+ t.string('name')
314
+ t.bigint('added_by_id')
315
+ t.jsonb('payload', null: false)
316
+ t.bigint('project_id', null: false)
317
+ t.datetime('created_at', precision: 6, null: false)
318
+ t.datetime('updated_at', precision: 6, null: false)
319
+ t.bigint('compose_file_id')
320
+ t.string('creation_source')
321
+ t.index(['project_id'], name: 'index_templates_on_project_id')
322
+ end
323
+
324
+ create_table('uffizzi_core_user_projects', force: :cascade) do |t|
325
+ t.bigint('user_id', null: false)
326
+ t.bigint('project_id', null: false)
327
+ t.text('role', null: false)
328
+ t.datetime('created_at', precision: 6, null: false)
329
+ t.datetime('updated_at', precision: 6, null: false)
330
+ t.bigint('invited_by_id')
331
+ t.index(['project_id'], name: 'index_user_projects_on_project_id')
332
+ t.index(['user_id', 'project_id'], name: 'index_user_projects_on_user_id_and_project_id')
333
+ t.index(['user_id'], name: 'index_user_projects_on_user_id')
334
+ end
335
+
336
+ create_table('uffizzi_core_users', force: :cascade) do |t|
337
+ t.string('first_name')
338
+ t.string('last_name')
339
+ t.string('email', default: '', null: false)
340
+ t.string('password_digest', default: '', null: false)
341
+ t.string('confirmation_token')
342
+ t.string('state')
343
+ t.string('phone')
344
+ t.datetime('created_at', precision: 6, null: false)
345
+ t.datetime('updated_at', precision: 6, null: false)
346
+ t.string('github')
347
+ t.string('website')
348
+ t.string('twitter')
349
+ t.string('linkedin')
350
+ t.string('devto')
351
+ t.string('facebook')
352
+ t.string('blog')
353
+ t.text('bio')
354
+ t.string('status')
355
+ t.string('availability')
356
+ t.string('primary_skills')
357
+ t.string('learning')
358
+ t.string('coding_for')
359
+ t.string('education')
360
+ t.string('title')
361
+ t.string('work')
362
+ t.string('primary_location')
363
+ t.string('creation_source')
364
+ t.index('lower((email)::text)', name: 'index_email_on_lower_email', unique: true)
365
+ end
366
+
367
+ create_table('uffizzi_core_users_roles', id: false, force: :cascade) do |t|
368
+ t.bigint('user_id')
369
+ t.bigint('role_id')
370
+ t.index(['role_id'], name: 'index_users_roles_on_role_id')
371
+ t.index(['user_id', 'role_id'], name: 'index_users_roles_on_user_id_and_role_id')
372
+ t.index(['user_id'], name: 'index_users_roles_on_user_id')
373
+ end
374
+ end
375
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RemoveSecretsFromProjects < ActiveRecord::Migration[6.1]
4
+ def change
5
+ remove_column('uffizzi_core_projects', 'secrets')
6
+ end
7
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ class CreateProjectSecrets < ActiveRecord::Migration[6.1]
4
+ def change
5
+ create_table('uffizzi_core_project_secrets', force: :cascade) do |t|
6
+ t.bigint('project_id', null: false)
7
+ t.string('name')
8
+ t.string('value')
9
+ t.datetime('created_at', precision: 6, null: false)
10
+ t.datetime('updated_at', precision: 6, null: false)
11
+ t.index(['project_id'], name: 'index_project_secrets_on_project_id')
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddNameToUffizziContainers < ActiveRecord::Migration[6.1]
4
+ def change
5
+ add_column(:uffizzi_core_containers, :name, :string)
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RenameProjectSecretsToSecrets < ActiveRecord::Migration[6.1]
4
+ def change
5
+ rename_table(:uffizzi_core_project_secrets, :uffizzi_core_secrets)
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddResourceToSecrets < ActiveRecord::Migration[6.1]
4
+ def change
5
+ add_belongs_to(:uffizzi_core_secrets, :resource, polymorphic: true)
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RemoveProjectRefFromSecrets < ActiveRecord::Migration[6.1]
4
+ def change
5
+ remove_reference(:uffizzi_core_secrets, :project)
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddHealthCheckToContainers < ActiveRecord::Migration[6.1]
4
+ def change
5
+ add_column :uffizzi_core_containers, :healthcheck, :jsonb
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RenameNameToUffizziContainers < ActiveRecord::Migration[6.1]
4
+ def change
5
+ rename_column(:uffizzi_core_containers, :name, :service_name)
6
+ end
7
+ end