roro 0.3.17 → 0.3.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (347) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +108 -70
  3. data/.gitignore +35 -8
  4. data/.ruby-version +1 -0
  5. data/Gemfile +1 -1
  6. data/Guardfile +23 -13
  7. data/README.md +11 -11
  8. data/bin/console +1 -1
  9. data/bin/setup +1 -1
  10. data/docker-compose.yml +3 -3
  11. data/lib/roro/cli/generate/generate.rb +52 -1
  12. data/lib/roro/cli/generate/generate_containers.rb +23 -0
  13. data/lib/roro/cli/generate/generate_environments.rb +25 -0
  14. data/lib/roro/cli/generate/generate_exposed.rb +11 -0
  15. data/lib/roro/cli/generate/generate_keys.rb +15 -0
  16. data/lib/roro/cli/generate/generate_mise.rb +13 -0
  17. data/lib/roro/cli/generate/generate_obfuscated.rb +14 -0
  18. data/lib/roro/cli/roll_your_own.rb +12 -0
  19. data/lib/roro/cli/rollon.rb +16 -16
  20. data/lib/roro/cli.rb +33 -17
  21. data/lib/roro/common/file_reflection.rb +33 -0
  22. data/lib/roro/common/utilities.rb +185 -0
  23. data/lib/roro/configurator.rb +15 -0
  24. data/lib/roro/configurators/adventure_case_builder.rb +65 -0
  25. data/lib/roro/configurators/adventure_chooser.rb +46 -0
  26. data/lib/roro/configurators/adventure_picker.rb +68 -0
  27. data/lib/roro/configurators/adventure_writer.rb +34 -0
  28. data/lib/roro/configurators/catalog_builder.rb +17 -0
  29. data/lib/roro/configurators/configurator.rb +64 -0
  30. data/lib/roro/configurators/eligibility.rb +141 -0
  31. data/lib/roro/configurators/question_asker.rb +29 -0
  32. data/lib/roro/configurators/question_builder.rb +83 -0
  33. data/lib/roro/configurators/structure_builder.rb +34 -0
  34. data/lib/roro/configurators/utilities.rb +188 -0
  35. data/lib/roro/configurators/validator.rb +109 -0
  36. data/lib/roro/crypto/cipher.rb +35 -0
  37. data/lib/roro/crypto/exposer.rb +33 -0
  38. data/lib/roro/crypto/file_writer.rb +14 -0
  39. data/lib/roro/crypto/key_writer.rb +35 -0
  40. data/lib/roro/crypto/obfuscator.rb +25 -0
  41. data/lib/roro/error.rb +31 -0
  42. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/fatsufodo.yml +1 -0
  43. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/django/django.yml +38 -0
  44. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/django/templates/stage_one/Dockerfile.tt +7 -0
  45. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/django/templates/stage_one/docker-compose.yml.tt +20 -0
  46. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/django/templates/stage_one/requirements.txt.tt +2 -0
  47. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/django/templates/stage_two/settings.py +130 -0
  48. data/lib/roro/{cli/templates/base/jumpstart → stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/django/test/stage_one/dummy}/.keep +0 -0
  49. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/django/test/stage_one/stage_one_test.rb +37 -0
  50. data/lib/roro/{cli/templates/base/roro → stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/django/test/stage_two/dummy}/.keep +0 -0
  51. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/expressjs/expressjs.yml +8 -0
  52. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/expressjs/templates/stage_one/Dockerfile.tt +14 -0
  53. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/expressjs/templates/stage_one/docker-compose.yml.tt +21 -0
  54. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/flask.yml +14 -0
  55. data/lib/roro/{cli/templates/base/roro/roro → stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/templates/stage_one}/.keep +0 -0
  56. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/templates/stage_one/Dockerfile +11 -0
  57. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/templates/stage_one/app.py +23 -0
  58. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/templates/stage_one/docker-compose.yml +8 -0
  59. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/templates/stage_one/requirements.txt +2 -0
  60. data/lib/roro/{cli/templates/base/roro/roro/containers → stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/test}/.keep +0 -0
  61. data/lib/roro/{cli/templates/base/roro/roro/containers/app → stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/test/stage_one}/.keep +0 -0
  62. data/lib/roro/{cli/templates/base/roro/roro/containers/frontend → stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/test/stage_one/stage_dummy}/.keep +0 -0
  63. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/test/stage_one/stage_test.rb +37 -0
  64. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/rails/rails.yml +12 -0
  65. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/rails/templates/stage_one/Dockerfile.tt +16 -0
  66. data/lib/roro/{cli/templates/rails/.circleci/.keep → stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/rails/templates/stage_one/Gemfile.lock.tt} +0 -0
  67. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/rails/templates/stage_one/Gemfile.tt +2 -0
  68. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/rails/templates/stage_one/docker-compose.yml.tt +9 -0
  69. data/lib/roro/{cli/templates/rails/roro/roro/docker-entrypoint.sh.tt → stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/rails/templates/stage_one/entrypoint.sh} +1 -1
  70. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/rails/templates/stage_two/database.yml.tt +16 -0
  71. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/wordpress/templates/stage_one/docker-compose.yml.tt +31 -0
  72. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/wordpress/wordpress.yml +17 -0
  73. data/lib/roro/stacks/catalog/unstoppable/developer_styles/okonomi/okonomi.yml +1 -0
  74. data/lib/roro/stacks/catalog/unstoppable/developer_styles/okonomi/stories/roll_your_own/roll_your_own.yml +23 -0
  75. data/lib/roro/stacks/catalog/unstoppable/developer_styles/okonomi/stories/roll_your_own/templates/stage_one/%interpolated_stack_path%/%interpolated_story_name%.yml.tt +10 -0
  76. data/lib/roro/{cli/templates/rails → stacks/catalog/unstoppable/developer_styles/okonomi/stories/roll_your_own/templates/stage_one/%interpolated_stack_path%/templates/stage_one}/.keep +0 -0
  77. data/lib/roro/{cli/templates/rails/database/with_postgresql → stacks/catalog/unstoppable/developer_styles/okonomi/stories/roll_your_own/templates/stage_one/%interpolated_stack_path%/test}/.keep +0 -0
  78. data/lib/roro/{cli/templates/rails/dotenv → stacks/catalog/unstoppable/developer_styles/okonomi/stories/roll_your_own/templates/stage_one/%interpolated_stack_path%/test/stage_one}/.keep +0 -0
  79. data/lib/roro/{cli/templates/rails/roro → stacks/catalog/unstoppable/developer_styles/okonomi/stories/roll_your_own/templates/stage_one/%interpolated_stack_path%/test/stage_one/stage_dummy}/.keep +0 -0
  80. data/lib/roro/stacks/catalog/unstoppable/developer_styles/okonomi/stories/roll_your_own/templates/stage_one/%interpolated_stack_path%/test/stage_one/stage_test.rb.tt +37 -0
  81. data/lib/roro/{cli/templates/rails/roro/containers → stacks/catalog/unstoppable/developer_styles/okonomi/stories/roll_your_own/test/stage_one/dummy}/.keep +0 -0
  82. data/lib/roro/stacks/catalog/unstoppable/developer_styles/okonomi/stories/roll_your_own/test/stage_one/stage_one_test.rb +58 -0
  83. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/omakase.yml +1 -0
  84. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/rails/rails.yml +13 -0
  85. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/rails/templates/stage_one/Dockerfile.tt +16 -0
  86. data/lib/roro/{cli/templates/rails/roro/containers/app/.keep → stacks/catalog/unstoppable/developer_styles/omakase/stories/rails/templates/stage_one/Gemfile.lock.tt} +0 -0
  87. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/rails/templates/stage_one/Gemfile.tt +2 -0
  88. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/rails/templates/stage_one/docker-compose.yml.tt +17 -0
  89. data/lib/roro/{cli/templates/rails/roro/docker-entrypoint.sh.tt → stacks/catalog/unstoppable/developer_styles/omakase/stories/rails/templates/stage_one/entrypoint.sh} +1 -1
  90. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/rails/templates/stage_two/database.yml.tt +16 -0
  91. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/.env +38 -0
  92. data/lib/roro/{cli/templates/rails/roro/containers/frontend → stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one}/.keep +0 -0
  93. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/LICENSE +674 -0
  94. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/README.md +346 -0
  95. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/build.sh +39 -0
  96. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/config/nginx/cfg/nginx-custom-configs.conf +117 -0
  97. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/config/nginx/cfg/nginx-wp-hardening.conf +131 -0
  98. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/config/nginx/tpl/nginx-http.conf.template +103 -0
  99. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/config/nginx/tpl/nginx-https.conf.example +123 -0
  100. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/config/php.conf.ini +3 -0
  101. data/lib/roro/{cli/templates/rails/roro/roro/.keep → stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/data/certbot/conf/.placeholder} +0 -0
  102. data/lib/roro/{cli/templates/rails/roro/roro/containers/.keep → stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/data/certbot/www/.placeholder} +0 -0
  103. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/docker-compose-build.yml +24 -0
  104. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/docker-compose-dev.yml +96 -0
  105. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/docker-compose-prod.yml +147 -0
  106. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/dump_mysql.sh +16 -0
  107. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/init_letsencrypt.sh +80 -0
  108. data/lib/roro/{cli/templates/rails/roro/roro/containers/app/.keep → stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/mysql-dumps/.placeholder} +0 -0
  109. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/push.sh +22 -0
  110. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/wordpress/Dockerfile +14 -0
  111. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/wordpress/adduser.sh +15 -0
  112. data/lib/roro/{cli/templates/rails/roro/roro/containers/frontend/.keep → stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/wordpress-sql/.placeholder} +0 -0
  113. data/lib/roro/{cli/templates/ruby_gem/.circleci/.keep → stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/wordpress-src/.placeholder} +0 -0
  114. data/lib/roro/{cli/templates/ruby_gem/roro/containers → stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/test}/.keep +0 -0
  115. data/lib/roro/{cli/templates/ruby_gem/roro/keys → stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/test/stage_one}/.keep +0 -0
  116. data/lib/roro/{cli/templates/stories → stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/test/stage_one/stage_dummy}/.keep +0 -0
  117. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/test/stage_one/stage_test.rb +40 -0
  118. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/wordpress.yml +76 -0
  119. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/fatsufodo.yml +1 -0
  120. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/django.yml +36 -0
  121. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/templates/stage_one/Dockerfile.tt +7 -0
  122. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/templates/stage_one/docker-compose.yml.tt +20 -0
  123. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/templates/stage_one/requirements.txt.tt +2 -0
  124. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/templates/stage_two/settings.py +130 -0
  125. data/lib/roro/{cli/templates/stories/with_postgresql → stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/test/stage_one/dummy}/.keep +0 -0
  126. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/test/stage_one/stage_one_test.rb +37 -0
  127. data/{roro/containers → lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/test/stage_two/dummy}/.keep +0 -0
  128. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/expressjs/expressjs.yml +7 -0
  129. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/expressjs/templates/stage_one/Dockerfile.tt +14 -0
  130. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/expressjs/templates/stage_one/docker-compose.yml.tt +21 -0
  131. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/rails/rails.yml +12 -0
  132. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/rails/templates/stage_one/Dockerfile.tt +16 -0
  133. data/{roro/keys/.keep → lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/rails/templates/stage_one/Gemfile.lock.tt} +0 -0
  134. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/rails/templates/stage_one/Gemfile.tt +2 -0
  135. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/rails/templates/stage_one/docker-compose.yml.tt +17 -0
  136. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/rails/templates/stage_one/entrypoint.sh +8 -0
  137. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/rails/templates/stage_two/database.yml.tt +16 -0
  138. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/__MACOSX/scripts/._.DS_Store +0 -0
  139. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/.DS_Store +0 -0
  140. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/base/bundler.sh +22 -0
  141. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/base/git.sh +21 -0
  142. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/base/rvm.sh +38 -0
  143. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/base/utilities.sh +53 -0
  144. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/base.sh +6 -0
  145. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/initialize/clone_idea.sh +14 -0
  146. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/initialize/clone_repos.sh +33 -0
  147. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/initialize/install_correct_bundler.sh +21 -0
  148. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/initialize/install_rubies.sh +6 -0
  149. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/initialize.sh +18 -0
  150. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/roro.sh +15 -0
  151. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/source.sh +28 -0
  152. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/utility/bundle_all.sh +12 -0
  153. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/utility/git_pull_all.sh +15 -0
  154. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/utility/rvm_install_all.sh +12 -0
  155. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/utility/yarn_install_all.sh +10 -0
  156. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/wordpress/templates/stage_one/docker-compose.yml.tt +31 -0
  157. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/wordpress/wordpress.yml +16 -0
  158. data/{sandbox → lib/roro/stacks/library/roro}/.keep +0 -0
  159. data/lib/roro/stacks/library/roro/docker_compose/docker-compose.yml +22 -0
  160. data/lib/roro/stacks/library/roro/k8s/k8s.yml +15 -0
  161. data/lib/roro/stacks/library/roro/plots/node/.keep +0 -0
  162. data/lib/roro/stacks/library/roro/plots/node/node.yml +22 -0
  163. data/lib/roro/stacks/library/roro/plots/php/.keep +0 -0
  164. data/lib/roro/stacks/library/roro/plots/php/php.yml +22 -0
  165. data/lib/roro/stacks/library/roro/plots/python/plots/django/.keep +0 -0
  166. data/lib/roro/stacks/library/roro/plots/python/plots/django/django.yml +10 -0
  167. data/lib/roro/stacks/library/roro/plots/python/plots/django/templates/Dockerfile +7 -0
  168. data/lib/roro/stacks/library/roro/plots/python/plots/django/templates/docker-compose.yml +20 -0
  169. data/lib/roro/stacks/library/roro/plots/python/plots/django/templates/requirements.txt +2 -0
  170. data/lib/roro/stacks/library/roro/plots/python/plots/flask/flask.yml +0 -0
  171. data/lib/roro/stacks/library/roro/plots/python/python.yml +1 -0
  172. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/databases/.keep +0 -0
  173. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/databases/mysql.yml +22 -0
  174. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/databases/postgres.yml +22 -0
  175. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/plots/rails/rails.yml +22 -0
  176. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/plots/rails/templates/.keep +0 -0
  177. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/plots/rails_react/rails_react.yml +22 -0
  178. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/plots/rails_react/templates/.keep +0 -0
  179. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/plots/rails_vue/rails_vue.yml +22 -0
  180. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/plots/rails_vue/templates/.keep +0 -0
  181. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/rails.yml +16 -0
  182. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/templates/.keep +0 -0
  183. data/lib/roro/stacks/library/roro/plots/ruby/plots/ruby_gem/ruby_gem.yml +22 -0
  184. data/lib/roro/stacks/library/roro/plots/ruby/ruby.yml +22 -0
  185. data/lib/roro/stacks/library/roro/roro/roro.yml +15 -0
  186. data/lib/roro/stacks/stories_v1/greenfield/rails.yml +9 -0
  187. data/lib/roro/stacks/stories_v1/greenfield/roro.yml +7 -0
  188. data/lib/roro/stacks/stories_v1/greenfield.yml +1 -0
  189. data/lib/roro/stacks/stories_v1/rollon/rails/ci_cd/circleci.yml +2 -0
  190. data/lib/roro/stacks/stories_v1/rollon/rails/ci_cd.yml +1 -0
  191. data/lib/roro/stacks/stories_v1/rollon/rails/database/mysql.yml +17 -0
  192. data/lib/roro/stacks/stories_v1/rollon/rails/database/postgresql.yml +15 -0
  193. data/lib/roro/stacks/stories_v1/rollon/rails/database.yml +9 -0
  194. data/lib/roro/stacks/stories_v1/rollon/rails/kubernetes/postgresql/default.yml +1 -0
  195. data/lib/roro/stacks/stories_v1/rollon/rails/kubernetes/postgresql/edge.yml +1 -0
  196. data/lib/roro/stacks/stories_v1/rollon/rails/kubernetes/postgresql.yml +10 -0
  197. data/lib/roro/stacks/stories_v1/rollon/rails/kubernetes.yml +1 -0
  198. data/lib/roro/stacks/stories_v1/rollon/rails.yml +76 -0
  199. data/lib/roro/stacks/stories_v1/rollon/roro.yml +5 -0
  200. data/lib/roro/stacks/stories_v1/rollon/ruby_gem.yml +5 -0
  201. data/lib/roro/stacks/stories_v1/rollon.yml +42 -0
  202. data/lib/roro/stacks/stories_v1/templates/rails/.circleci/.keep +0 -0
  203. data/lib/roro/{cli → stacks/stories_v1}/templates/rails/.circleci/config.yml.tt +4 -6
  204. data/lib/roro/{cli → stacks/stories_v1}/templates/rails/.circleci/jobs/_build.yml +4 -6
  205. data/lib/roro/stacks/stories_v1/templates/rails/.circleci/jobs/_push.yml +11 -0
  206. data/lib/roro/stacks/stories_v1/templates/rails/.circleci/jobs/_test.yml +12 -0
  207. data/lib/roro/{cli → stacks/stories_v1}/templates/rails/.circleci/setup-gem-credentials.sh +0 -0
  208. data/lib/roro/stacks/stories_v1/templates/rails/.circleci/workflows/_build_test_push.yml +12 -0
  209. data/lib/roro/stacks/stories_v1/templates/rails/.keep +0 -0
  210. data/lib/roro/stacks/stories_v1/templates/rails/Dockerfile.greenfield.tt +51 -0
  211. data/lib/roro/{cli → stacks/stories_v1}/templates/rails/config/database.mysql.yml +0 -0
  212. data/lib/roro/{cli → stacks/stories_v1}/templates/rails/config/database.pg.yml +2 -3
  213. data/lib/roro/stacks/stories_v1/templates/rails/database/with_mysql/_service.yml +10 -0
  214. data/lib/roro/stacks/stories_v1/templates/rails/database/with_postgresql/.keep +0 -0
  215. data/lib/roro/stacks/stories_v1/templates/rails/database/with_postgresql/_service.yml +7 -0
  216. data/lib/roro/{cli → stacks/stories_v1}/templates/rails/docker-compose.yml.tt +3 -3
  217. data/lib/roro/stacks/stories_v1/templates/rails/dotenv/.keep +0 -0
  218. data/lib/roro/stacks/stories_v1/templates/rails/dotenv/database.mysql.env.tt +6 -0
  219. data/lib/roro/stacks/stories_v1/templates/rails/dotenv/database.pg.env.tt +4 -0
  220. data/lib/roro/{cli → stacks/stories_v1}/templates/rails/dotenv/web.env.tt +0 -0
  221. data/lib/roro/stacks/stories_v1/templates/rails/kube.rake.tt +114 -0
  222. data/lib/roro/stacks/stories_v1/templates/rails/roro/.keep +0 -0
  223. data/lib/roro/stacks/stories_v1/templates/rails/roro/containers/.keep +0 -0
  224. data/lib/roro/stacks/stories_v1/templates/rails/roro/containers/app/.keep +0 -0
  225. data/lib/roro/stacks/stories_v1/templates/rails/roro/containers/app/Dockerfile.tt +34 -0
  226. data/lib/roro/stacks/stories_v1/templates/rails/roro/containers/frontend/.keep +0 -0
  227. data/lib/roro/{cli/templates/base/roro/roro/docker-entrypoint.sh.tt → stacks/stories_v1/templates/rails/roro/docker-entrypoint.sh} +0 -0
  228. data/lib/roro/stacks/stories_v1/templates/rails/roro/keys/.keep +0 -0
  229. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/.keep +0 -0
  230. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/certificate.yml.tt +0 -0
  231. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/cluster-issuer.yml.tt +0 -0
  232. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/deployment.yml.tt +50 -0
  233. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/deployments/postgres_deploy.yaml +47 -0
  234. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/deployments/rails_deploy.yaml +62 -0
  235. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/deployments/redis_deploy.yaml +23 -0
  236. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/deployments/sidekiq_deploy.yaml +56 -0
  237. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/ingress.yml.tt +0 -0
  238. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/ingresses/ingress.yaml +13 -0
  239. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/job-migrate.yml.tt +0 -0
  240. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/jobs/setup.yaml +42 -0
  241. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/secret-digital-ocean.yml.tt +4 -0
  242. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/service.yml.tt +10 -0
  243. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/services/postgres_svc.yaml +13 -0
  244. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/services/rails_svc.yaml +13 -0
  245. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/services/redis_svc.yaml +13 -0
  246. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/volumes/postgres_volumes.yaml +25 -0
  247. data/lib/roro/stacks/stories_v1/templates/roro/containers/.keep +0 -0
  248. data/lib/roro/stacks/stories_v1/templates/roro/containers/database/env/.keep +0 -0
  249. data/lib/roro/stacks/stories_v1/templates/roro/containers/database/scripts/.keep +0 -0
  250. data/lib/roro/stacks/stories_v1/templates/roro/env/.keep +0 -0
  251. data/lib/roro/stacks/stories_v1/templates/roro/keys/.keep +0 -0
  252. data/lib/roro/stacks/stories_v1/templates/roro/scripts/.keep +0 -0
  253. data/lib/roro/stacks/stories_v1/templates/roro/scripts/base/bundler.sh +22 -0
  254. data/lib/roro/stacks/stories_v1/templates/roro/scripts/base/git.sh +21 -0
  255. data/lib/roro/stacks/stories_v1/templates/roro/scripts/base/rvm.sh +38 -0
  256. data/lib/roro/stacks/stories_v1/templates/roro/scripts/base/utilities.sh +53 -0
  257. data/lib/roro/stacks/stories_v1/templates/roro/scripts/base.sh +6 -0
  258. data/lib/roro/stacks/stories_v1/templates/roro/scripts/initialize/clone_idea.sh +14 -0
  259. data/lib/roro/stacks/stories_v1/templates/roro/scripts/initialize/clone_repos.sh +33 -0
  260. data/lib/roro/stacks/stories_v1/templates/roro/scripts/initialize/install_correct_bundler.sh +21 -0
  261. data/lib/roro/stacks/stories_v1/templates/roro/scripts/initialize/install_rubies.sh +6 -0
  262. data/lib/roro/stacks/stories_v1/templates/roro/scripts/initialize.sh +18 -0
  263. data/lib/roro/stacks/stories_v1/templates/roro/scripts/roro.sh +15 -0
  264. data/lib/roro/stacks/stories_v1/templates/roro/scripts/source.sh +28 -0
  265. data/lib/roro/stacks/stories_v1/templates/roro/scripts/utility/bundle_all.sh +12 -0
  266. data/lib/roro/stacks/stories_v1/templates/roro/scripts/utility/git_pull_all.sh +15 -0
  267. data/lib/roro/stacks/stories_v1/templates/roro/scripts/utility/rvm_install_all.sh +12 -0
  268. data/lib/roro/stacks/stories_v1/templates/roro/scripts/utility/yarn_install_all.sh +10 -0
  269. data/lib/roro/stacks/stories_v1/templates/ruby_gem/.circleci/.keep +0 -0
  270. data/lib/roro/{cli → stacks/stories_v1}/templates/ruby_gem/.circleci/config.yml.tt +4 -4
  271. data/lib/roro/{cli/templates/base/.circleci/jobs/_build.yml → stacks/stories_v1/templates/ruby_gem/.circleci/jobs/_test.yml} +2 -2
  272. data/lib/roro/{cli → stacks/stories_v1}/templates/ruby_gem/.circleci/setup-gem-credentials.sh +0 -0
  273. data/lib/roro/{cli → stacks/stories_v1}/templates/ruby_gem/docker-compose.yml +1 -1
  274. data/lib/roro/stacks/stories_v1/templates/ruby_gem/roro/containers/.keep +0 -0
  275. data/lib/roro/{cli → stacks/stories_v1}/templates/ruby_gem/roro/containers/ruby_image/Dockerfile.tt +1 -1
  276. data/lib/roro/stacks/stories_v1/templates/ruby_gem/roro/containers/ruby_image/ci.env.tt +1 -0
  277. data/lib/roro/stacks/stories_v1/templates/ruby_gem/roro/keys/.keep +0 -0
  278. data/lib/roro/version.rb +1 -1
  279. data/lib/roro.rb +60 -4
  280. data/mise/containers/ruby_gem/Dockerfile +16 -0
  281. data/mise/containers/ruby_gem/Dockerfile-app +51 -0
  282. data/{roro/containers/ruby_image/Dockerfile → mise/containers/ruby_gem/Dockerfile-ruby_gem} +0 -0
  283. data/mise/containers/ruby_gem/env/.keep +0 -0
  284. data/mise/containers/ruby_gem/env/base.env.enc +1 -0
  285. data/mise/containers/ruby_gem/env/ci.env.enc +2 -0
  286. data/mise/containers/ruby_gem/env/development.env.enc +1 -0
  287. data/mise/containers/ruby_gem/env/production.env.enc +1 -0
  288. data/mise/containers/ruby_gem/scripts/.keep +0 -0
  289. data/mise/env/base.env.enc +1 -0
  290. data/mise/env/ci.env.enc +1 -0
  291. data/mise/env/development.env.enc +1 -0
  292. data/mise/env/production.env.enc +1 -0
  293. data/mise/mise.roro +0 -0
  294. data/process.yml +401 -0
  295. data/roro.gemspec +8 -11
  296. metadata +353 -111
  297. data/lib/roro/cli/base/base.rb +0 -8
  298. data/lib/roro/cli/base/base_files.rb +0 -24
  299. data/lib/roro/cli/base/check_dependencies.rb +0 -97
  300. data/lib/roro/cli/base/continuous_integration.rb +0 -13
  301. data/lib/roro/cli/base/insert_gems.rb +0 -31
  302. data/lib/roro/cli/base/insertions.rb +0 -19
  303. data/lib/roro/cli/base/utilities.rb +0 -38
  304. data/lib/roro/cli/configuration.rb +0 -69
  305. data/lib/roro/cli/generate/config/rails.rb +0 -17
  306. data/lib/roro/cli/generate/config.rb +0 -11
  307. data/lib/roro/cli/generate/exposed.rb +0 -14
  308. data/lib/roro/cli/generate/keys.rb +0 -69
  309. data/lib/roro/cli/generate/obfuscated.rb +0 -17
  310. data/lib/roro/cli/greenfield/rails.rb +0 -36
  311. data/lib/roro/cli/rollon/rails/database/with_mysql.rb +0 -22
  312. data/lib/roro/cli/rollon/rails/database/with_postgresql.rb +0 -21
  313. data/lib/roro/cli/rollon/rails/database.rb +0 -30
  314. data/lib/roro/cli/rollon/rails.rb +0 -47
  315. data/lib/roro/cli/rollon/ruby_gem/with_ci_cd.rb +0 -45
  316. data/lib/roro/cli/rollon/ruby_gem.rb +0 -1
  317. data/lib/roro/cli/rollon/stories/stories.rb +0 -3
  318. data/lib/roro/cli/rollon/stories.rb +0 -2
  319. data/lib/roro/cli/roro_configurator.yml +0 -157
  320. data/lib/roro/cli/templates/base/.circleci/_defaults.yml +0 -17
  321. data/lib/roro/cli/templates/base/.circleci/_workflow.yml +0 -2
  322. data/lib/roro/cli/templates/base/.circleci/config.job-example.yml +0 -33
  323. data/lib/roro/cli/templates/base/.circleci/jobs/_release.yml +0 -12
  324. data/lib/roro/cli/templates/base/.circleci/workflows/_build_release.yml +0 -10
  325. data/lib/roro/cli/templates/base/.dockerignore +0 -51
  326. data/lib/roro/cli/templates/base/.roro_config.yml +0 -15
  327. data/lib/roro/cli/templates/base/dotenv +0 -1
  328. data/lib/roro/cli/templates/base/jumpstart/Dockerfile.tt +0 -30
  329. data/lib/roro/cli/templates/base/jumpstart/docker-compose.yml +0 -59
  330. data/lib/roro/cli/templates/base/jumpstart/docker-entrypoint.sh +0 -16
  331. data/lib/roro/cli/templates/base/livereload/hosts.example +0 -7
  332. data/lib/roro/cli/templates/rails/.circleci/_aliases.yml +0 -8
  333. data/lib/roro/cli/templates/rails/.circleci/jobs/_push.yml +0 -23
  334. data/lib/roro/cli/templates/rails/.circleci/jobs/_test.yml +0 -13
  335. data/lib/roro/cli/templates/rails/.circleci/workflows/_build_test_push.yml +0 -9
  336. data/lib/roro/cli/templates/rails/Dockerfile.greenfield.tt +0 -47
  337. data/lib/roro/cli/templates/rails/database/with_mysql/_service.yml +0 -10
  338. data/lib/roro/cli/templates/rails/database/with_postgresql/_service.yml +0 -7
  339. data/lib/roro/cli/templates/rails/dotenv/database.mysql.env.tt +0 -3
  340. data/lib/roro/cli/templates/rails/dotenv/database.pg.env.tt +0 -4
  341. data/lib/roro/cli/templates/rails/roro/containers/app/Dockerfile.tt +0 -88
  342. data/lib/roro/cli/templates/ruby_gem/roro/containers/ruby_image/ci.env.tt +0 -1
  343. data/lib/roro/cli/templates/stories/ruby_gem/with_ci_cd/_build.yml +0 -11
  344. data/lib/roro/cli/templates/stories/with_mysql/_service.yml +0 -10
  345. data/lib/roro/cli/templates/stories/with_postgresql/_service.yml +0 -7
  346. data/lib/tasks/deploy.rake +0 -126
  347. data/roro/containers/ruby_image/ci.env.enc +0 -2
@@ -0,0 +1,9 @@
1
+ stories: postgresql
2
+
3
+ actions:
4
+ - |
5
+ Roro::CLI.roro_environments.each do |environment|
6
+ src = 'rails/dotenv/web.env.tt'
7
+ dest = "roro/containers/app/#{environment}.env"
8
+ template src, dest, @config.env
9
+ end
@@ -0,0 +1,10 @@
1
+ stories:
2
+ - default
3
+ - edge
4
+
5
+ actions:
6
+ - template 'rails/.circleci/config.yml.tt', './.circleci/config.yml'
7
+ - template 'rails/preface-returns-array_of_strings.yml.tt', './preface-returns-array_of_strings.yml', @config.smart.env
8
+ - template 'base/dotenv', './.smart.env', @config.smart.env
9
+ - directory 'rails/roro', './roro', @config.smart.env
10
+ - template 'rails/kube.rake.tt', './lib/tasks/kube.rake', @config.smart.env
@@ -0,0 +1 @@
1
+ stories: postgresql
@@ -0,0 +1,76 @@
1
+ stories:
2
+ - database
3
+ - ci_cd
4
+ - kubernetes
5
+
6
+ actions:
7
+ - template 'rails/.circleci/config.yml.tt', './.circleci/config.yml'
8
+ - template 'rails/preface-returns-array_of_strings.yml.tt', './preface-returns-array_of_strings.yml', @config.smart.env
9
+ - template 'base/dotenv', './.smart.env', @config.smart.env
10
+ - directory 'rails/roro', './roro', @config.smart.env
11
+ - chmod "roro/docker-entrypoint.sh", 0755
12
+
13
+
14
+ startup:
15
+ success: "Your backend should be available at http://localhost:3000"
16
+ commands:
17
+ - docker-compose build --no-cache
18
+ - docker-compose up -d
19
+ - docker-compose run backend bin/rails db:create
20
+ - docker-compose run backend bin/rails db:migrate
21
+ - 'docker-compose run backend echo #{success_msg}'
22
+
23
+ env_vars:
24
+ ruby_version: '2.7'
25
+ database_host: database
26
+ frontend_service: frontend
27
+ database_service: database
28
+
29
+ choices:
30
+ config_std_out_true:
31
+ question: |
32
+ The team at Heroku, among others, recommend logging to STDOUT
33
+ and treating your logs as streams. We'll set this to
34
+ true as an environment variable but it may also be helpful
35
+ to configure './config/boot.rb' with '$stdout.sync = true'
36
+ just in case that doesn't work.
37
+ Would you like to configure this?
38
+ choices:
39
+ y: 'Yes'
40
+ n: 'No'
41
+ default: y
42
+
43
+ insert_roro_gem_into_gemfile:
44
+ question: |
45
+ Many developers believe it's good idea to secure sensitive
46
+ environment files and variables. You can use RoRo to
47
+ generate secret keys known only to you for use in any
48
+ environment, and then use them to encrypt and decrypt
49
+ these files. Would you like to add RoRo to your Gemfile?
50
+ choices:
51
+ y: 'Yes'
52
+ n: 'No'
53
+ default: n
54
+
55
+ gitignore_sensitive_files:
56
+ question: |
57
+ If you plan to use the environment files RoRo generates for
58
+ your own environment variables, it's a good idea to keep
59
+ these files out of source control. Would you like RoRo to
60
+ modify your .gitignore file to accomplish this for you ?
61
+ choices:
62
+ y: 'Yes'
63
+ n: 'No'
64
+ default: y
65
+
66
+ insert_hfci_gem_into_gemfile:
67
+ question: |
68
+ Jim Weirich passed too soon and remains missed. In addition
69
+ to Rake, Jim wrote a beautiful gem called 'Given' that makes
70
+ Rspec and Minitest less ugly and thus your tests more easy to
71
+ write. Would you like to install a gem called
72
+ handsome_fencer-test that allows you to try it out?
73
+ choices:
74
+ y: 'Yes'
75
+ n: 'No'
76
+ default: n
@@ -0,0 +1,5 @@
1
+ greenfield_actions:
2
+ - |
3
+ src = 'roro'
4
+ dest = 'roro'
5
+ template src, dest, @config.env
@@ -0,0 +1,5 @@
1
+ story:
2
+ ci_cd: circleci
3
+ env_vars:
4
+ ruby_version: '2.7'
5
+
@@ -0,0 +1,42 @@
1
+ stories: rails
2
+
3
+ intentions:
4
+
5
+ env_vars:
6
+ main_app_name:
7
+ developer:
8
+ name: your-name
9
+ email: your.email@example.com
10
+ docker_email: your-docker-registry-email
11
+ docker_org: your-docker-registry-org-name
12
+ docker_password: your-docker-registry-password
13
+ docker_token: your-docker-registry-token
14
+ docker_username: your-docker-registry-user-name
15
+
16
+ choices:
17
+
18
+ generate_config_story:
19
+ question: |
20
+ Would you like to create a Roro Config file to help with debugging,
21
+ sharing your desired story, or both?
22
+ choices:
23
+ y: 'Yes'
24
+ n: 'No'
25
+ default: y
26
+
27
+ backup_existing_files:
28
+ question: |
29
+ RoRo will be generating a number of files, some of which will
30
+ replace existing ones. Would you like to back them up?
31
+ choices:
32
+ y: 'Yes'
33
+ n: 'No'
34
+ default: n
35
+
36
+ copy_dockerignore:
37
+ question: |
38
+ Would you like to create a .dockerignore file?
39
+ choices:
40
+ y: 'Yes'
41
+ n: 'No'
42
+ default: y
@@ -1,13 +1,11 @@
1
- <%= yaml_from_template("rails/.circleci/_aliases.yml") %>
2
-
1
+ <%= yaml_from_template("base/.circleci/_version.yml") %>
3
2
  <%= yaml_from_template("base/.circleci/_defaults.yml") %>
3
+ <%= yaml_from_template("base/.circleci/_major_only.yml") %>
4
+ <%= yaml_from_template("base/.circleci/_executors.yml") %>
5
+ <%= yaml_from_template("base/.circleci/_commands.yml") %>
4
6
 
5
7
  <%= yaml_from_template("rails/.circleci/jobs/_build.yml") %>
6
-
7
8
  <%= yaml_from_template("rails/.circleci/jobs/_test.yml") %>
8
-
9
9
  <%= yaml_from_template("rails/.circleci/jobs/_push.yml") %>
10
-
11
10
  <%= yaml_from_template("base/.circleci/_workflow.yml") %>
12
-
13
11
  <%= yaml_from_template("rails/.circleci/workflows/_build_test_push.yml") %>
@@ -1,16 +1,14 @@
1
+ jobs:
1
2
  build:
2
3
  <<: *defaults
3
4
  steps:
4
5
  - checkout
5
- - run: |
6
- gem install roro
7
- roro generate::exposed ci
6
+ - run: gem install roro
7
+ - run: roro generate::exposed ci
8
8
  - run: |
9
9
  mkdir -p workspace
10
10
  cp -r roro workspace/
11
11
  - persist_to_workspace:
12
12
  root: workspace
13
13
  paths:
14
- - roro
15
- - run: *source-ci-variables
16
- - run: RORO_ENV=ci docker-compose build
14
+ - roro
@@ -0,0 +1,11 @@
1
+ push:
2
+ <<: *defaults
3
+ steps:
4
+ - checkout
5
+ - attach-roro
6
+ - run: docker-compose build
7
+ - run: docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}
8
+ - tag-and-push:
9
+ deploy_tag: ${DEPLOY_TAG}
10
+ - tag-and-push:
11
+ deploy_tag: 'latest'
@@ -0,0 +1,12 @@
1
+ test:
2
+ <<: *defaults
3
+ steps:
4
+ - checkout
5
+ - attach-roro
6
+ - run: docker-compose build
7
+ - run: docker-compose up -d
8
+ - run: docker-compose run backend bundle
9
+ - run: docker-compose run backend yarn
10
+ - run: docker-compose run backend bin/rails db:create
11
+ - run: docker-compose run backend bin/rails db:migrate
12
+ - run: docker-compose run backend bin/rails test
@@ -0,0 +1,12 @@
1
+ build-test-push:
2
+ jobs:
3
+ - build:
4
+ <<: *major_only
5
+ - test:
6
+ <<: *major_only
7
+ requires:
8
+ - build
9
+ - push:
10
+ <<: *major_only
11
+ requires:
12
+ - build
File without changes
@@ -0,0 +1,51 @@
1
+ FROM ruby:<%= config[:ruby_version] %>-alpine AS builder
2
+
3
+ LABEL maintainer="<%= config[:docker_email] %> using RoRo"
4
+
5
+ # Add basic packages
6
+ RUN apk add --no-cache \
7
+ build-base \
8
+ postgresql-dev \
9
+ git \
10
+ nodejs \
11
+ yarn \
12
+ tzdata \
13
+ file
14
+
15
+ ## Set APP_HOME and BUNDLE_PATH as using ENV instructions:
16
+ ENV APP_HOME /usr/src/app/
17
+ ENV BUNDLE_PATH /gems
18
+
19
+ ## Create both as directories to make sure they exist:
20
+ RUN mkdir -p ${APP_HOME}
21
+ RUN mkdir ${BUNDLE_PATH}
22
+
23
+ ## Tell Docker to create volumes for our workspace and gems
24
+ ## so other containers can access them.
25
+
26
+ RUN gem install bundler:2.1.4
27
+
28
+ WORKDIR ${APP_HOME}
29
+
30
+ ## Create a Gemfile with just the Rails gem inside:
31
+ RUN echo -e "source 'https://rubygems.org'\ngem 'rails', '6.1.3.1'" > Gemfile
32
+
33
+ ## Bundle to install rails:
34
+ RUN bundle install
35
+
36
+ ## Use Rails to generate a new app. We'll configure it later.
37
+ RUN bundle exec rails new . \
38
+ --database=postgresql \
39
+ --skip-bundle \
40
+ --skip-webpack-install
41
+ RUN bundle --jobs 4
42
+ RUN bundle exec rails webpacker:install
43
+ RUN bundle exec rails yarn:install
44
+ ## Tell docker not to create a layer:
45
+ FROM scratch AS export-stage
46
+
47
+ ## Copy the generated files onto the host. Note that because we are in a
48
+ ## new container, we don't have access to the previous ${APP_HOME}
49
+ ## variable and so we must hard code it as our source:
50
+ COPY --from=builder /usr/src/app/ .
51
+
@@ -2,9 +2,9 @@ default: &default
2
2
  adapter: postgresql
3
3
  encoding: unicode
4
4
  host: <%= ENV.fetch('DATABASE_HOST') %>
5
- username: <%= ENV.fetch('POSTGRES_USER') %>
5
+ username: <%= ENV.fetch('POSTGRES_USERNAME') %>
6
6
  password: <%= ENV.fetch('POSTGRES_PASSWORD') %>
7
- database: <%= ENV.fetch('POSTGRES_DB') %>
7
+ database: <%= ENV.fetch('POSTGRES_DATABASE') %>
8
8
  pool: 5
9
9
  variables:
10
10
  statement_timeout: 5000
@@ -15,6 +15,5 @@ development:
15
15
  test:
16
16
  <<: *default
17
17
 
18
-
19
18
  production:
20
19
  <<: *default
@@ -0,0 +1,10 @@
1
+ database:
2
+ image: mysql:5.7
3
+ env_file:
4
+ - roro/containers/database/${RORO_ENV:-development}.smart.env
5
+ - roro/containers/backend/${RORO_ENV:-development}.smart.env
6
+ volumes:
7
+ - db_data:/var/lib/mysql
8
+ restart: always
9
+ ports:
10
+ - '3307:3306'
@@ -0,0 +1,7 @@
1
+ database:
2
+ image: postgres
3
+ env_file:
4
+ - roro/containers/database/${RORO_ENV:-development}.smart.env
5
+ - roro/containers/backend/${RORO_ENV:-development}.smart.env
6
+ volumes:
7
+ - db_data:/var/lib/postgresql/data
@@ -2,7 +2,7 @@ version: '3.2'
2
2
 
3
3
  services:
4
4
 
5
- web:
5
+ app:
6
6
  build:
7
7
  context: .
8
8
  dockerfile: roro/containers/app/Dockerfile
@@ -10,7 +10,6 @@ services:
10
10
  - database
11
11
  - redis
12
12
 
13
- command: ["bin/rails", "s", "-b", "0.0.0.0"]
14
13
  ports:
15
14
  - "3000:3000"
16
15
  - "4000:4000"
@@ -22,6 +21,7 @@ services:
22
21
  - roro/containers/database/${RORO_ENV:-development}.env
23
22
  environment:
24
23
  - WEBPACKER_DEV_SERVER_HOST=webpack_dev_server
24
+ command: ["bin/rails", "s", "-b", "0.0.0.0"]
25
25
 
26
26
  webpack_dev_server:
27
27
  build:
@@ -44,7 +44,7 @@ services:
44
44
  redis:
45
45
  image: redis
46
46
 
47
- <%= yaml_from_template("rails/database/with_#{config['database_vendor']}/_service.yml") %>
47
+ <%= yaml_from_template("rails/database/with_#{config[:database_vendor]}/_service.yml") %>
48
48
 
49
49
  system_tests:
50
50
  image: selenium/standalone-chrome-debug
@@ -0,0 +1,6 @@
1
+ MYSQL_DATABASE=<%= config[:main_app_name] + "_" + config[:rails_env] + "_db" %>
2
+ MYSQL_DATABASE_PORT=<%= config[:mysql_database_port] %>
3
+ MYSQL_ROOT_PASSWORD=<%= config[:mysql_root_password] %>
4
+ MYSQL_PASSWORD=<%= config[:mysql_password] %>
5
+ MYSQL_USERNAME=<%= config[:mysql_username] %>
6
+ RAILS_ENV=<%= config[:rails_env] %>
@@ -0,0 +1,4 @@
1
+ POSTGRES_USERNAME=<%= config[:postgres_username] %>
2
+ POSTGRES_PASSWORD=<%= config[:postgres_password] %>
3
+ POSTGRES_DATABASE=<%= config[:main_app_name] + "_" + config[:rails_env] + "_db" %>
4
+ RAILS_ENV=<%= config[:rails_env] %>
@@ -0,0 +1,114 @@
1
+ # require 'dotenv/tasks'
2
+
3
+ # Rake.application.options.trace = false
4
+
5
+ # Dotenv.load('.env.production.cluster')
6
+
7
+ namespace :kube do
8
+
9
+ desc 'Rollout a new deployment'
10
+ task :deploy do
11
+ apply "kube/deployment.yml"
12
+ puts `kubectl rollout restart deployment <%= config[:main_app_name] %>-deployment`
13
+ end
14
+
15
+ desc 'Print useful information aout our Kubernete setup'
16
+ task :list do
17
+ kubectl 'get pods --all-namespaces'
18
+ kubectl 'get services --all-namespaces'
19
+ kubectl 'get ingresses --all-namespaces'
20
+ end
21
+
22
+ desc 'Apply our Kubernete configurations to our cluster'
23
+ task :setup do
24
+
25
+ kubectl "apply -f #{Rails.root}/roro/kube/service.yml"
26
+
27
+ # # Add our Docker Hub credentials to our cluster
28
+ # kubectl(%Q{create secret docker-registry regcred \
29
+ # --docker-server=#{ENV['DOCKER_REGISTRY_SERVER']} \
30
+ # --docker-username=#{ENV['DOCKER_USERNAME']} \
31
+ # --docker-password=#{ENV['DOCKER_PASSWORD']} \
32
+ # --docker-email=#{ENV['DOCKER_EMAIL']} || true
33
+ # })
34
+
35
+ # # Install our Service Component
36
+ # apply "kube/service.yml"
37
+
38
+ # # Install our Rails app Deployment
39
+ # apply "kube/deployment.yml"
40
+
41
+ # # Installs Nginx Ingress controller
42
+ # apply "https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml"
43
+
44
+ # # Add a load balancer
45
+ # apply "https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/cloud-generic.yaml"
46
+
47
+ # # Install our Ingress that will link our load balancer to our service(s)
48
+ # apply "kube/ingress.yml"
49
+
50
+ # # Add the Digital Ocean token to the cluster
51
+ # apply "kube/secret-digital-ocean.yml"
52
+
53
+ # # Install cert-manager
54
+ # kubectl 'create namespace cert-manager'
55
+ # apply "https://github.com/jetstack/cert-manager/releases/download/v0.14.0/cert-manager.yaml"
56
+
57
+ # # Add our certificate
58
+ # apply "kube/certificate.yml"
59
+
60
+ # # Add the certificate issuer
61
+ # apply "kube/cluster-issuer.yml"
62
+ end
63
+
64
+ desc "Set the number of instances to run in the cluster"
65
+ task :scale, [:count] => [:environment] do |t, args|
66
+ kubectl "scale deployments/myapp-deployment --replicas #{args[:count]}"
67
+ end
68
+
69
+ desc "Run database migrates the database"
70
+ task :migrate do
71
+ apply "kube/job-migrate.yml"
72
+ end
73
+
74
+ desc "Open a session to a pod on the cluster"
75
+ task :shell do
76
+ exec "kubectl exec -it #{find_first_pod_name} bash"
77
+ end
78
+
79
+ desc "Tail the log files on production"
80
+ task :logs do
81
+ exec 'kubectl logs -f -l app=myapp --all-containers'
82
+ end
83
+
84
+ desc "Runs a command in production"
85
+ task :run, [:command] => [:environment] do |t, args|
86
+ kubectl "exec -it #{find_first_pod_name} echo $(#{args[:command]})"
87
+ end
88
+
89
+ desc "Run rails console in production"
90
+ task :console do
91
+ system "kubectl exec -it #{find_first_pod_name} bundle exec rails console"
92
+ end
93
+
94
+ desc "Print the environment variables"
95
+ task :config do
96
+ system "kubectl exec -it #{find_first_pod_name} printenv | sort"
97
+ end
98
+
99
+ def apply(configuration)
100
+ if File.file?(configuration)
101
+ puts %x{envsubst < #{configuration} | kubectl apply -f -}
102
+ else
103
+ kubectl "apply -f #{configuration}"
104
+ end
105
+ end
106
+
107
+ def kubectl(command)
108
+ print %x{ kubectl #{command} }
109
+ end
110
+
111
+ def find_first_pod_name
112
+ `kubectl get pods|grep myapp-deployment|awk '{print $1}'|head -n 1`.to_s.strip
113
+ end
114
+ end
@@ -0,0 +1,34 @@
1
+ ## The FROM instruction below builds our first layer using an official image:
2
+ FROM ruby:<%= config[:ruby_version] %>-alpine
3
+
4
+ LABEL maintainer="<%= config[:docker_email] %> using RoRo"
5
+
6
+ # Add basic packages
7
+ RUN apk add --no-cache \
8
+ build-base \
9
+ postgresql-dev \
10
+ nodejs \
11
+ yarn \
12
+ tzdata \
13
+ file
14
+
15
+ ## Set APP_HOME and BUNDLE_PATH as using ENV instructions:
16
+ ENV APP_HOME /usr/src/app/
17
+ ENV BUNDLE_PATH /gems
18
+
19
+ ## Create both as directories to make sure they exist:
20
+ RUN mkdir -p ${APP_HOME}
21
+ RUN mkdir ${BUNDLE_PATH}
22
+
23
+ ## Tell Docker to create volumes for our workspace and gems
24
+ ## so other containers can access them.
25
+
26
+ RUN gem install bundler:2.1.4
27
+
28
+ WORKDIR ${APP_HOME}
29
+
30
+ COPY Gemfile* ./
31
+
32
+ RUN bundle --jobs 4
33
+ COPY . ${APP_HOME}
34
+
@@ -0,0 +1,50 @@
1
+ # ./kube/deployment.yml
2
+
3
+ apiVersion: apps/v1
4
+ kind: Deployment
5
+ metadata:
6
+ name: <%= config[:main_app_name] %>-app-deployment
7
+ labels:
8
+ app: <%= config[:main_app_name] %>-app
9
+ tier: app
10
+ spec:
11
+ replicas: 2
12
+ minReadySeconds: 5
13
+ strategy:
14
+ type: RollingUpdate
15
+ rollingUpdate:
16
+ maxSurge: 1
17
+ maxUnavailable: 1
18
+ selector:
19
+ matchLabels:
20
+ app: <%= config[:main_app_name] %>-app
21
+ tier: app
22
+ template:
23
+ metadata:
24
+ labels:
25
+ app: rubytags
26
+ tier: app
27
+ spec:
28
+ imagePullSecrets:
29
+ - name: docker-registry
30
+ containers:
31
+ - name: <%= config[:main_app_name] %>-app
32
+ image: <%= config[:docker_org] %>/<%= config[:main_app_name] %>-app
33
+ imagePullPolicy: Always
34
+ ports:
35
+ - containerPort: 3000
36
+ env:
37
+ - name: RAILS_LOG_TO_STDOUT
38
+ value: 'true'
39
+ - name: SECRET_KEY_BASE
40
+ value: '$SECRET_KEY_BASE'
41
+ - name: RAILS_ENV
42
+ value: '$RAILS_ENV'
43
+ - name: DATABASE_USERNAME
44
+ value: '$DATABASE_USERNAME'
45
+ - name: DATABASE_PASSWORD
46
+ value: '$DATABASE_PASSWORD'
47
+ - name: DATABASE_HOST
48
+ value: '$DATABASE_HOST'
49
+ - name: DATABASE_PORT
50
+ value: '$DATABASE_PORT'