roro 0.3.21 → 0.3.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (336) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +95 -67
  3. data/.gitignore +38 -8
  4. data/.ruby-version +1 -0
  5. data/CODE_OF_CONDUCT.md +25 -17
  6. data/Gemfile +1 -1
  7. data/Guardfile +23 -11
  8. data/README.md +9 -10
  9. data/bin/console +1 -1
  10. data/bin/setup +1 -1
  11. data/docker-compose.yml +3 -3
  12. data/lib/roro/cli/generate/generate.rb +52 -1
  13. data/lib/roro/cli/generate/generate_containers.rb +23 -0
  14. data/lib/roro/cli/generate/generate_environments.rb +25 -0
  15. data/lib/roro/cli/generate/generate_exposed.rb +11 -0
  16. data/lib/roro/cli/generate/generate_keys.rb +15 -0
  17. data/lib/roro/cli/generate/generate_mise.rb +13 -0
  18. data/lib/roro/cli/generate/generate_obfuscated.rb +14 -0
  19. data/lib/roro/cli/roll_your_own.rb +12 -0
  20. data/lib/roro/cli/rollon.rb +11 -138
  21. data/lib/roro/cli.rb +30 -20
  22. data/lib/roro/common/file_reflection.rb +33 -0
  23. data/lib/roro/common/utilities.rb +185 -0
  24. data/lib/roro/configurator.rb +14 -14
  25. data/lib/roro/configurators/adventure_case_builder.rb +65 -0
  26. data/lib/roro/configurators/adventure_chooser.rb +46 -0
  27. data/lib/roro/configurators/adventure_picker.rb +68 -0
  28. data/lib/roro/configurators/adventure_writer.rb +34 -0
  29. data/lib/roro/configurators/catalog_builder.rb +17 -0
  30. data/lib/roro/configurators/configurator.rb +64 -0
  31. data/lib/roro/configurators/eligibility.rb +141 -0
  32. data/lib/roro/configurators/question_asker.rb +29 -0
  33. data/lib/roro/configurators/question_builder.rb +83 -0
  34. data/lib/roro/configurators/structure_builder.rb +34 -0
  35. data/lib/roro/configurators/utilities.rb +188 -0
  36. data/lib/roro/configurators/validator.rb +109 -0
  37. data/lib/roro/crypto/cipher.rb +35 -0
  38. data/lib/roro/crypto/exposer.rb +33 -0
  39. data/lib/roro/crypto/file_writer.rb +14 -0
  40. data/lib/roro/crypto/key_writer.rb +35 -0
  41. data/lib/roro/crypto/obfuscator.rb +25 -0
  42. data/lib/roro/error.rb +31 -0
  43. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/fatsufodo.yml +1 -0
  44. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/django/django.yml +38 -0
  45. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/django/templates/stage_one/Dockerfile.tt +7 -0
  46. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/django/templates/stage_one/docker-compose.yml.tt +20 -0
  47. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/django/templates/stage_one/requirements.txt.tt +2 -0
  48. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/django/templates/stage_two/settings.py +130 -0
  49. data/lib/roro/{templates/base/jumpstart → stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/django/test/stage_one/dummy}/.keep +0 -0
  50. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/django/test/stage_one/stage_one_test.rb +37 -0
  51. data/lib/roro/{templates/base/roro → stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/django/test/stage_two/dummy}/.keep +0 -0
  52. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/expressjs/expressjs.yml +8 -0
  53. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/expressjs/templates/stage_one/Dockerfile.tt +14 -0
  54. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/expressjs/templates/stage_one/docker-compose.yml.tt +21 -0
  55. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/flask.yml +14 -0
  56. data/lib/roro/{templates/base/roro/roro → stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/templates/stage_one}/.keep +0 -0
  57. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/templates/stage_one/Dockerfile +11 -0
  58. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/templates/stage_one/app.py +23 -0
  59. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/templates/stage_one/docker-compose.yml +8 -0
  60. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/templates/stage_one/requirements.txt +2 -0
  61. data/lib/roro/{templates/base/roro/roro/containers → stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/test}/.keep +0 -0
  62. data/lib/roro/{templates/base/roro/roro/containers/app → stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/test/stage_one}/.keep +0 -0
  63. data/lib/roro/{templates/base/roro/roro/containers/frontend → stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/test/stage_one/stage_dummy}/.keep +0 -0
  64. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/flask/test/stage_one/stage_test.rb +37 -0
  65. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/rails/rails.yml +12 -0
  66. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/rails/templates/stage_one/Dockerfile.tt +16 -0
  67. data/lib/roro/{templates/rails/.circleci/.keep → stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/rails/templates/stage_one/Gemfile.lock.tt} +0 -0
  68. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/rails/templates/stage_one/Gemfile.tt +2 -0
  69. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/rails/templates/stage_one/docker-compose.yml.tt +9 -0
  70. data/lib/roro/{templates/base/roro/roro/docker-entrypoint.sh.tt → stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/rails/templates/stage_one/entrypoint.sh} +1 -1
  71. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/rails/templates/stage_two/database.yml.tt +16 -0
  72. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/wordpress/templates/stage_one/docker-compose.yml.tt +31 -0
  73. data/lib/roro/stacks/catalog/unstoppable/developer_styles/fatsufodo/stories/wordpress/wordpress.yml +17 -0
  74. data/lib/roro/stacks/catalog/unstoppable/developer_styles/okonomi/okonomi.yml +1 -0
  75. data/lib/roro/stacks/catalog/unstoppable/developer_styles/okonomi/stories/roll_your_own/roll_your_own.yml +23 -0
  76. 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
  77. data/lib/roro/{templates/rails → stacks/catalog/unstoppable/developer_styles/okonomi/stories/roll_your_own/templates/stage_one/%interpolated_stack_path%/templates/stage_one}/.keep +0 -0
  78. data/lib/roro/{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
  79. data/lib/roro/{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
  80. data/lib/roro/{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
  81. 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
  82. data/lib/roro/{templates/rails/roro/containers → stacks/catalog/unstoppable/developer_styles/okonomi/stories/roll_your_own/test/stage_one/dummy}/.keep +0 -0
  83. data/lib/roro/stacks/catalog/unstoppable/developer_styles/okonomi/stories/roll_your_own/test/stage_one/stage_one_test.rb +58 -0
  84. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/omakase.yml +1 -0
  85. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/rails/rails.yml +13 -0
  86. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/rails/templates/stage_one/Dockerfile.tt +16 -0
  87. data/lib/roro/{templates/rails/roro/containers/app/.keep → stacks/catalog/unstoppable/developer_styles/omakase/stories/rails/templates/stage_one/Gemfile.lock.tt} +0 -0
  88. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/rails/templates/stage_one/Gemfile.tt +2 -0
  89. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/rails/templates/stage_one/docker-compose.yml.tt +17 -0
  90. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/rails/templates/stage_one/entrypoint.sh +8 -0
  91. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/rails/templates/stage_two/database.yml.tt +16 -0
  92. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/.env +38 -0
  93. data/lib/roro/{templates/rails/roro/containers/frontend → stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one}/.keep +0 -0
  94. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/LICENSE +674 -0
  95. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/README.md +346 -0
  96. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/build.sh +39 -0
  97. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/config/nginx/cfg/nginx-custom-configs.conf +117 -0
  98. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/config/nginx/cfg/nginx-wp-hardening.conf +131 -0
  99. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/config/nginx/tpl/nginx-http.conf.template +103 -0
  100. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/config/nginx/tpl/nginx-https.conf.example +123 -0
  101. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/config/php.conf.ini +3 -0
  102. data/lib/roro/{templates/rails/roro/kube/.keep → stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/data/certbot/conf/.placeholder} +0 -0
  103. data/lib/roro/{templates/rails/roro/kube/certificate.yml.tt → stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/data/certbot/www/.placeholder} +0 -0
  104. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/docker-compose-build.yml +24 -0
  105. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/docker-compose-dev.yml +96 -0
  106. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/docker-compose-prod.yml +147 -0
  107. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/dump_mysql.sh +16 -0
  108. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/init_letsencrypt.sh +80 -0
  109. data/lib/roro/{templates/rails/roro/kube/cluster-issuer.yml.tt → stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/mysql-dumps/.placeholder} +0 -0
  110. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/push.sh +22 -0
  111. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/wordpress/Dockerfile +14 -0
  112. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/wordpress/adduser.sh +15 -0
  113. data/lib/roro/{templates/rails/roro/kube/ingress.yml.tt → stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/wordpress-sql/.placeholder} +0 -0
  114. data/lib/roro/{templates/rails/roro/kube/job-migrate.yml.tt → stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/templates/stage_one/wordpress-src/.placeholder} +0 -0
  115. data/lib/roro/{templates/ruby_gem/.circleci → stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/test}/.keep +0 -0
  116. data/lib/roro/{templates/ruby_gem/roro/containers → stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/test/stage_one}/.keep +0 -0
  117. data/lib/roro/{templates/ruby_gem/roro/keys → stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/test/stage_one/stage_dummy}/.keep +0 -0
  118. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/test/stage_one/stage_test.rb +40 -0
  119. data/lib/roro/stacks/catalog/unstoppable/developer_styles/omakase/stories/wordpress/wordpress.yml +76 -0
  120. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/fatsufodo.yml +1 -0
  121. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/django.yml +36 -0
  122. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/templates/stage_one/Dockerfile.tt +7 -0
  123. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/templates/stage_one/docker-compose.yml.tt +20 -0
  124. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/templates/stage_one/requirements.txt.tt +2 -0
  125. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/templates/stage_two/settings.py +130 -0
  126. data/{roro/containers → lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/test/stage_one/dummy}/.keep +0 -0
  127. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/test/stage_one/stage_one_test.rb +37 -0
  128. data/{roro/keys → lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/django/test/stage_two/dummy}/.keep +0 -0
  129. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/expressjs/expressjs.yml +7 -0
  130. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/expressjs/templates/stage_one/Dockerfile.tt +14 -0
  131. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/expressjs/templates/stage_one/docker-compose.yml.tt +21 -0
  132. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/rails/rails.yml +12 -0
  133. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/rails/templates/stage_one/Dockerfile.tt +16 -0
  134. data/{sandbox/.keep → lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/rails/templates/stage_one/Gemfile.lock.tt} +0 -0
  135. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/rails/templates/stage_one/Gemfile.tt +2 -0
  136. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/rails/templates/stage_one/docker-compose.yml.tt +17 -0
  137. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/rails/templates/stage_one/entrypoint.sh +8 -0
  138. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/rails/templates/stage_two/database.yml.tt +16 -0
  139. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/__MACOSX/scripts/._.DS_Store +0 -0
  140. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/.DS_Store +0 -0
  141. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/base/bundler.sh +22 -0
  142. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/base/git.sh +21 -0
  143. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/base/rvm.sh +38 -0
  144. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/base/utilities.sh +53 -0
  145. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/base.sh +6 -0
  146. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/initialize/clone_idea.sh +14 -0
  147. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/initialize/clone_repos.sh +33 -0
  148. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/initialize/install_correct_bundler.sh +21 -0
  149. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/initialize/install_rubies.sh +6 -0
  150. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/initialize.sh +18 -0
  151. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/roro.sh +15 -0
  152. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/source.sh +28 -0
  153. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/utility/bundle_all.sh +12 -0
  154. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/utility/git_pull_all.sh +15 -0
  155. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/utility/rvm_install_all.sh +12 -0
  156. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/roro/templates/scripts/utility/yarn_install_all.sh +10 -0
  157. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/wordpress/templates/stage_one/docker-compose.yml.tt +31 -0
  158. data/lib/roro/stacks/catalog/unstoppable/developer_styles/sashimi/stories/wordpress/wordpress.yml +16 -0
  159. data/lib/roro/stacks/library/roro/.keep +0 -0
  160. data/lib/roro/stacks/library/roro/docker_compose/docker-compose.yml +22 -0
  161. data/lib/roro/stacks/library/roro/k8s/k8s.yml +15 -0
  162. data/lib/roro/stacks/library/roro/plots/node/.keep +0 -0
  163. data/lib/roro/stacks/library/roro/plots/node/node.yml +22 -0
  164. data/lib/roro/stacks/library/roro/plots/php/.keep +0 -0
  165. data/lib/roro/stacks/library/roro/plots/php/php.yml +22 -0
  166. data/lib/roro/stacks/library/roro/plots/python/plots/django/.keep +0 -0
  167. data/lib/roro/stacks/library/roro/plots/python/plots/django/django.yml +10 -0
  168. data/lib/roro/stacks/library/roro/plots/python/plots/django/templates/Dockerfile +7 -0
  169. data/lib/roro/stacks/library/roro/plots/python/plots/django/templates/docker-compose.yml +20 -0
  170. data/lib/roro/stacks/library/roro/plots/python/plots/django/templates/requirements.txt +2 -0
  171. data/lib/roro/stacks/library/roro/plots/python/plots/flask/flask.yml +0 -0
  172. data/lib/roro/stacks/library/roro/plots/python/python.yml +1 -0
  173. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/databases/.keep +0 -0
  174. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/databases/mysql.yml +22 -0
  175. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/databases/postgres.yml +22 -0
  176. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/plots/rails/rails.yml +22 -0
  177. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/plots/rails/templates/.keep +0 -0
  178. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/plots/rails_react/rails_react.yml +22 -0
  179. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/plots/rails_react/templates/.keep +0 -0
  180. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/plots/rails_vue/rails_vue.yml +22 -0
  181. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/plots/rails_vue/templates/.keep +0 -0
  182. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/rails.yml +16 -0
  183. data/lib/roro/stacks/library/roro/plots/ruby/plots/rails/templates/.keep +0 -0
  184. data/lib/roro/stacks/library/roro/plots/ruby/plots/ruby_gem/ruby_gem.yml +22 -0
  185. data/lib/roro/stacks/library/roro/plots/ruby/ruby.yml +22 -0
  186. data/lib/roro/stacks/library/roro/roro/roro.yml +15 -0
  187. data/lib/roro/{stories → stacks/stories_v1}/greenfield/rails.yml +2 -2
  188. data/lib/roro/stacks/stories_v1/greenfield/roro.yml +7 -0
  189. data/lib/roro/{stories → stacks/stories_v1}/greenfield.yml +0 -0
  190. data/lib/roro/{stories → stacks/stories_v1}/rollon/rails/ci_cd/circleci.yml +0 -0
  191. data/lib/roro/{stories → stacks/stories_v1}/rollon/rails/ci_cd.yml +0 -0
  192. data/lib/roro/{stories → stacks/stories_v1}/rollon/rails/database/mysql.yml +1 -1
  193. data/lib/roro/{stories → stacks/stories_v1}/rollon/rails/database/postgresql.yml +1 -1
  194. data/lib/roro/{stories → stacks/stories_v1}/rollon/rails/database.yml +0 -0
  195. data/lib/roro/{stories → stacks/stories_v1}/rollon/rails/kubernetes/postgresql/default.yml +0 -0
  196. data/lib/roro/{stories → stacks/stories_v1}/rollon/rails/kubernetes/postgresql/edge.yml +0 -0
  197. data/lib/roro/stacks/stories_v1/rollon/rails/kubernetes/postgresql.yml +10 -0
  198. data/lib/roro/{stories → stacks/stories_v1}/rollon/rails/kubernetes.yml +0 -0
  199. data/lib/roro/{stories → stacks/stories_v1}/rollon/rails.yml +7 -7
  200. data/lib/roro/stacks/stories_v1/rollon/roro.yml +5 -0
  201. data/lib/roro/{stories → stacks/stories_v1}/rollon/ruby_gem.yml +0 -0
  202. data/lib/roro/{stories → stacks/stories_v1}/rollon.yml +0 -0
  203. data/lib/roro/stacks/stories_v1/templates/rails/.circleci/.keep +0 -0
  204. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/.circleci/config.yml.tt +0 -0
  205. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/.circleci/jobs/_build.yml +1 -1
  206. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/.circleci/jobs/_push.yml +1 -1
  207. data/lib/roro/stacks/stories_v1/templates/rails/.circleci/jobs/_test.yml +12 -0
  208. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/.circleci/setup-gem-credentials.sh +0 -0
  209. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/.circleci/workflows/_build_test_push.yml +0 -0
  210. data/lib/roro/stacks/stories_v1/templates/rails/.keep +0 -0
  211. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/Dockerfile.greenfield.tt +1 -1
  212. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/config/database.mysql.yml +0 -0
  213. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/config/database.pg.yml +0 -0
  214. data/lib/roro/stacks/stories_v1/templates/rails/database/with_mysql/_service.yml +10 -0
  215. data/lib/roro/stacks/stories_v1/templates/rails/database/with_postgresql/.keep +0 -0
  216. data/lib/roro/stacks/stories_v1/templates/rails/database/with_postgresql/_service.yml +7 -0
  217. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/docker-compose.yml.tt +0 -0
  218. data/lib/roro/stacks/stories_v1/templates/rails/dotenv/.keep +0 -0
  219. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/dotenv/database.mysql.env.tt +0 -0
  220. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/dotenv/database.pg.env.tt +0 -0
  221. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/dotenv/web.env.tt +0 -0
  222. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/kube.rake.tt +0 -0
  223. data/lib/roro/stacks/stories_v1/templates/rails/roro/.keep +0 -0
  224. data/lib/roro/stacks/stories_v1/templates/rails/roro/containers/.keep +0 -0
  225. data/lib/roro/stacks/stories_v1/templates/rails/roro/containers/app/.keep +0 -0
  226. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/roro/containers/app/Dockerfile.tt +0 -0
  227. data/lib/roro/stacks/stories_v1/templates/rails/roro/containers/frontend/.keep +0 -0
  228. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/roro/docker-entrypoint.sh +0 -0
  229. data/lib/roro/stacks/stories_v1/templates/rails/roro/keys/.keep +0 -0
  230. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/.keep +0 -0
  231. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/certificate.yml.tt +0 -0
  232. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/cluster-issuer.yml.tt +0 -0
  233. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/roro/kube/deployment.yml.tt +0 -0
  234. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/roro/kube/deployments/postgres_deploy.yaml +3 -3
  235. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/roro/kube/deployments/rails_deploy.yaml +5 -5
  236. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/roro/kube/deployments/redis_deploy.yaml +2 -2
  237. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/roro/kube/deployments/sidekiq_deploy.yaml +3 -3
  238. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/ingress.yml.tt +0 -0
  239. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/roro/kube/ingresses/ingress.yaml +0 -0
  240. data/lib/roro/stacks/stories_v1/templates/rails/roro/kube/job-migrate.yml.tt +0 -0
  241. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/roro/kube/jobs/setup.yaml +1 -1
  242. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/roro/kube/secret-digital-ocean.yml.tt +0 -0
  243. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/roro/kube/service.yml.tt +0 -0
  244. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/roro/kube/services/postgres_svc.yaml +2 -2
  245. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/roro/kube/services/rails_svc.yaml +3 -3
  246. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/roro/kube/services/redis_svc.yaml +2 -2
  247. data/lib/roro/{templates → stacks/stories_v1/templates}/rails/roro/kube/volumes/postgres_volumes.yaml +0 -0
  248. data/lib/roro/stacks/stories_v1/templates/roro/containers/.keep +0 -0
  249. data/lib/roro/stacks/stories_v1/templates/roro/containers/database/env/.keep +0 -0
  250. data/lib/roro/stacks/stories_v1/templates/roro/containers/database/scripts/.keep +0 -0
  251. data/lib/roro/stacks/stories_v1/templates/roro/env/.keep +0 -0
  252. data/lib/roro/stacks/stories_v1/templates/roro/keys/.keep +0 -0
  253. data/lib/roro/stacks/stories_v1/templates/roro/scripts/.keep +0 -0
  254. data/lib/roro/stacks/stories_v1/templates/roro/scripts/base/bundler.sh +22 -0
  255. data/lib/roro/stacks/stories_v1/templates/roro/scripts/base/git.sh +21 -0
  256. data/lib/roro/stacks/stories_v1/templates/roro/scripts/base/rvm.sh +38 -0
  257. data/lib/roro/stacks/stories_v1/templates/roro/scripts/base/utilities.sh +53 -0
  258. data/lib/roro/stacks/stories_v1/templates/roro/scripts/base.sh +6 -0
  259. data/lib/roro/stacks/stories_v1/templates/roro/scripts/initialize/clone_idea.sh +14 -0
  260. data/lib/roro/stacks/stories_v1/templates/roro/scripts/initialize/clone_repos.sh +33 -0
  261. data/lib/roro/stacks/stories_v1/templates/roro/scripts/initialize/install_correct_bundler.sh +21 -0
  262. data/lib/roro/stacks/stories_v1/templates/roro/scripts/initialize/install_rubies.sh +6 -0
  263. data/lib/roro/stacks/stories_v1/templates/roro/scripts/initialize.sh +18 -0
  264. data/lib/roro/stacks/stories_v1/templates/roro/scripts/roro.sh +15 -0
  265. data/lib/roro/stacks/stories_v1/templates/roro/scripts/source.sh +28 -0
  266. data/lib/roro/stacks/stories_v1/templates/roro/scripts/utility/bundle_all.sh +12 -0
  267. data/lib/roro/stacks/stories_v1/templates/roro/scripts/utility/git_pull_all.sh +15 -0
  268. data/lib/roro/stacks/stories_v1/templates/roro/scripts/utility/rvm_install_all.sh +12 -0
  269. data/lib/roro/stacks/stories_v1/templates/roro/scripts/utility/yarn_install_all.sh +10 -0
  270. data/lib/roro/stacks/stories_v1/templates/ruby_gem/.circleci/.keep +0 -0
  271. data/lib/roro/{templates → stacks/stories_v1/templates}/ruby_gem/.circleci/config.yml.tt +0 -0
  272. data/lib/roro/{templates → stacks/stories_v1/templates}/ruby_gem/.circleci/jobs/_test.yml +0 -0
  273. data/lib/roro/{templates → stacks/stories_v1/templates}/ruby_gem/.circleci/setup-gem-credentials.sh +0 -0
  274. data/lib/roro/{templates → stacks/stories_v1/templates}/ruby_gem/docker-compose.yml +1 -1
  275. data/lib/roro/stacks/stories_v1/templates/ruby_gem/roro/containers/.keep +0 -0
  276. data/lib/roro/{templates → stacks/stories_v1/templates}/ruby_gem/roro/containers/ruby_image/Dockerfile.tt +0 -0
  277. data/lib/roro/{templates → stacks/stories_v1/templates}/ruby_gem/roro/containers/ruby_image/ci.env.tt +0 -0
  278. data/lib/roro/stacks/stories_v1/templates/ruby_gem/roro/keys/.keep +0 -0
  279. data/lib/roro/version.rb +1 -1
  280. data/lib/roro.rb +60 -6
  281. data/mise/containers/ruby_gem/Dockerfile +16 -0
  282. data/{roro/containers/app/Dockerfile → mise/containers/ruby_gem/Dockerfile-app} +0 -0
  283. data/{roro/containers/ruby_image/Dockerfile → mise/containers/ruby_gem/Dockerfile-ruby_gem} +0 -0
  284. data/mise/containers/ruby_gem/env/.keep +0 -0
  285. data/mise/containers/ruby_gem/env/base.env.enc +1 -0
  286. data/mise/containers/ruby_gem/env/ci.env.enc +2 -0
  287. data/mise/containers/ruby_gem/env/development.env.enc +1 -0
  288. data/mise/containers/ruby_gem/env/production.env.enc +1 -0
  289. data/mise/containers/ruby_gem/scripts/.keep +0 -0
  290. data/mise/env/base.env.enc +1 -0
  291. data/mise/env/ci.env.enc +1 -0
  292. data/mise/env/development.env.enc +1 -0
  293. data/mise/env/production.env.enc +1 -0
  294. data/mise/mise.roro +0 -0
  295. data/roro.gemspec +7 -1
  296. metadata +338 -119
  297. data/lib/roro/cli/generate/exposed.rb +0 -14
  298. data/lib/roro/cli/generate/keys.rb +0 -69
  299. data/lib/roro/cli/generate/obfuscated.rb +0 -17
  300. data/lib/roro/cli/generate/story.rb +0 -18
  301. data/lib/roro/cli/greenfield/rails.rb +0 -14
  302. data/lib/roro/cli/rollon/rails/base/base.rb +0 -4
  303. data/lib/roro/cli/rollon/rails/base/insert_gems.rb +0 -23
  304. data/lib/roro/cli/rollon/rails/base/insertions.rb +0 -27
  305. data/lib/roro/cli/rollon/rails/database/with_mysql.rb +0 -22
  306. data/lib/roro/cli/rollon/rails/database/with_postgresql.rb +0 -20
  307. data/lib/roro/cli/rollon/rails/database.rb +0 -26
  308. data/lib/roro/cli/rollon/ruby_gem/with_ci_cd.rb +0 -45
  309. data/lib/roro/cli/rollon/ruby_gem.rb +0 -1
  310. data/lib/roro/cli/rollon/stories.rb +0 -2
  311. data/lib/roro/configurator/eligibility.rb +0 -137
  312. data/lib/roro/configurator/okonomi.rb +0 -28
  313. data/lib/roro/configurator/omakase.rb +0 -170
  314. data/lib/roro/crypto.rb +0 -73
  315. data/lib/roro/stories/rollon/rails/kubernetes/postgresql.yml +0 -10
  316. data/lib/roro/templates/base/.circleci/_aliases.yml +0 -8
  317. data/lib/roro/templates/base/.circleci/_commands.yml +0 -31
  318. data/lib/roro/templates/base/.circleci/_defaults.yml +0 -5
  319. data/lib/roro/templates/base/.circleci/_executors.yml +0 -11
  320. data/lib/roro/templates/base/.circleci/_major_only.yml +0 -4
  321. data/lib/roro/templates/base/.circleci/_version.yml +0 -1
  322. data/lib/roro/templates/base/.circleci/_workflow.yml +0 -2
  323. data/lib/roro/templates/base/.circleci/config.job-example.yml +0 -33
  324. data/lib/roro/templates/base/.circleci/jobs/_build.yml +0 -4
  325. data/lib/roro/templates/base/.circleci/jobs/_release.yml +0 -12
  326. data/lib/roro/templates/base/.circleci/workflows/_build_release.yml +0 -10
  327. data/lib/roro/templates/base/.dockerignore +0 -51
  328. data/lib/roro/templates/base/dotenv +0 -1
  329. data/lib/roro/templates/base/jumpstart/Dockerfile.tt +0 -30
  330. data/lib/roro/templates/base/jumpstart/docker-compose.yml +0 -59
  331. data/lib/roro/templates/base/jumpstart/docker-entrypoint.sh +0 -16
  332. data/lib/roro/templates/base/livereload/hosts.example +0 -7
  333. data/lib/roro/templates/rails/.circleci/jobs/_test.yml +0 -12
  334. data/lib/roro/templates/rails/database/with_mysql/_service.yml +0 -10
  335. data/lib/roro/templates/rails/database/with_postgresql/_service.yml +0 -7
  336. data/roro/containers/ruby_image/ci.env.enc +0 -2
@@ -1,69 +0,0 @@
1
- module Roro
2
-
3
- class CLI < Thor
4
-
5
- desc "generate::key", "Generate a key inside roro/keys. Takes the name of
6
- an environment as an argument to private .env files from
7
- encrypted .env.enc files inside the roro directory.
8
- Expose encrypted files"
9
-
10
- map "generate::key" => "generate_key"
11
- method_option :environment, type: :hash, default: {}, desc: "Pass a list of environment variables like so: env:var", banner: "development, staging"
12
-
13
- def generate_key(*args)
14
- generate_key_or_keys(*args)
15
- end
16
-
17
- desc "generate::keys", "Generate keys for each environment inside roro/keys.
18
- If you have .env files like 'roro/containers/app/[staging_env].env' and
19
- 'roro/[circle_ci_env].env' it will generate '/roro/keys/[staging_env].key'
20
- and '/roro/keys/[circle_ci_env].key'."
21
- map "generate::keys" => "generate_keys"
22
-
23
- def generate_keys(*args)
24
- generate_key(*args)
25
- end
26
-
27
- no_commands do
28
-
29
- def generate_key_or_keys(*args)
30
- environments = args.first ? [args.first] : gather_environments
31
- environments.each do |environment|
32
-
33
- confirm_files_decrypted?(environment)
34
- create_file "roro/keys/#{environment}.key", encoded_key
35
- end
36
- end
37
-
38
- def encoded_key
39
- @cipher = OpenSSL::Cipher.new 'AES-128-CBC'
40
- @salt = '8 octets'
41
- @new_key = @cipher.random_key
42
- Base64.encode64(@new_key)
43
- end
44
-
45
- def gather_environments
46
- environments = []
47
- ['.env', '.env.enc'].each do |extension|
48
- Roro::Crypto.source_files('roro', extension).each do |env_file|
49
- environments << env_file.split('/').last.split(extension).last
50
- end
51
- end
52
- environments.uniq
53
- end
54
-
55
- def confirm_files_decrypted?(environment)
56
- orphan_encrypted = []
57
- Roro::Crypto.source_files('.', '.env.enc').each do |file|
58
- unless File.exist? file.split('.enc').first
59
- orphan_encrypted << file
60
- end
61
- end
62
- if !orphan_encrypted.empty?
63
- raise Roro::Error.new("You have an encrypted files (.env.enc) #{orphan_encrypted} that do not have corresponding decrypted files (.env). Please decrypt or remove these encrypted files before generating a new key for #{environment}.")
64
- end
65
- true
66
- end
67
- end
68
- end
69
- end
@@ -1,17 +0,0 @@
1
- require 'roro/crypto'
2
-
3
- module Roro
4
-
5
- class CLI < Thor
6
-
7
- desc "generate::obfuscated", "obfuscates any files matching the pattern ./roro/**/*.env"
8
- map "generate::obfuscated" => "generate_obfuscated"
9
-
10
- def generate_obfuscated(*args)
11
- environments = args.first ? [args.first] : gather_environments
12
- environments.each do |environment|
13
- Roro::Crypto.obfuscate(environment, 'roro')
14
- end
15
- end
16
- end
17
- end
@@ -1,18 +0,0 @@
1
- module Roro
2
- class CLI < Thor
3
-
4
- desc "generate::story", "Generate a config file at .roro_config.yml to use later"
5
- map "generate::story" => "generate_story"
6
-
7
- def generate_story
8
-
9
- @config ||= Roro::Configuration.new(options)
10
- # configuration = {
11
- # env_vars: @config.env.keys,
12
- # intentions: @config.intentions,
13
- # story: @config.structure['story']
14
- # }
15
- # create_file ".roro_configurator.yml", @config.env.to_yaml
16
- end
17
- end
18
- end
@@ -1,14 +0,0 @@
1
- module Roro
2
-
3
- class CLI < Thor
4
-
5
- desc "greenfield::rails", "Greenfield a new, dockerized rails app with
6
- either MySQL or PostgreSQL in a separate container."
7
-
8
- map "greenfield::rails" => "greenfield_rails"
9
-
10
- def greenfield_rails
11
- greenfield( { story: :rails } )
12
- end
13
- end
14
- end
@@ -1,4 +0,0 @@
1
-
2
- require_relative 'insertions.rb'
3
- require_relative 'insert_gems.rb'
4
-
@@ -1,23 +0,0 @@
1
-
2
- module Roro
3
-
4
- class CLI < Thor
5
-
6
- no_commands do
7
-
8
- def insert_roro_gem_into_gemfile
9
- insert_into_file 'Gemfile', "gem 'roro'\n\n", before: "group :development, :test do"
10
- end
11
-
12
- def insert_db_gem(gem)
13
- gems = %w(sqlite pg mysql2)
14
- gems.each { |g| gsub_file('Gemfile', /.*#{g}.*/, '')}
15
- insert_into_file 'Gemfile', "gem '#{gem}'\n\n", before: "group :development, :test"
16
- end
17
-
18
- def insert_hfci_gem_into_gemfile
19
- insert_into_file 'Gemfile', "gem 'handsome_fencer-test'\n\n", after: "group :development, :test do"
20
- end
21
- end
22
- end
23
- end
@@ -1,27 +0,0 @@
1
-
2
- module Roro
3
-
4
- class CLI < Thor
5
-
6
- no_commands do
7
-
8
- def config_std_out_true
9
- file = 'config/boot.rb'
10
- line = "$stdout.sync = true\n\n"
11
- prepend_to_file(file, line, force: true)
12
- end
13
-
14
- def copy_dockerignore
15
- copy_file 'base/.dockerignore', '.dockerignore'
16
- end
17
-
18
- def gitignore_sensitive_files
19
- append_to_file ".gitignore", "\nroro/**/*.env\nroro/**/*.key"
20
- append_to_file ".gitignore", "\nroro/**/*.env\nroro/**/*.key"
21
- append_to_file ".gitignore", "\n*kubeconfig.yaml"
22
- append_to_file ".gitignore", "\n*kubeconfig.yml"
23
- append_to_file ".gitignore", "\n*.roro_configurator.yml"
24
- end
25
- end
26
- end
27
- end
@@ -1,22 +0,0 @@
1
- module Roro
2
-
3
- class CLI < Thor
4
-
5
- no_commands do
6
-
7
- def configure_for_mysql
8
- insert_db_gem('mysql2')
9
- copy_file 'rails/config/database.mysql.yml', 'config/database.yml', force: true
10
- config = @config.env.clone
11
-
12
- %w(development production test staging ci).each do |environment|
13
- config[:rails_env] = environment
14
-
15
- source = 'rails/dotenv/database.mysql.env.tt'
16
- target = "roro/containers/database/#{environment}.env"
17
- template( source, target, config )
18
- end
19
- end
20
- end
21
- end
22
- end
@@ -1,20 +0,0 @@
1
- module Roro
2
-
3
- class CLI < Thor
4
-
5
- no_commands do
6
-
7
- def configure_for_pg
8
- copy_file 'rails/config/database.pg.yml', 'config/database.yml', force: true
9
- config = @config.env.clone
10
- %w(development production test staging ci).each do |environment|
11
- config[:rails_env] = environment
12
-
13
- source = 'rails/dotenv/database.pg.env.tt'
14
- target = "roro/containers/database/#{environment}.env"
15
- template( source, target, config )
16
- end
17
- end
18
- end
19
- end
20
- end
@@ -1,26 +0,0 @@
1
- module Roro
2
-
3
- class CLI < Thor
4
-
5
- no_commands do
6
-
7
- def configure_database
8
- database = @config.intentions[:configure_database]
9
- case database
10
- when 'p'
11
- @config.env[:database_vendor] = 'postgresql'
12
- configure_for_pg
13
- when 'm'
14
- @config.env[:database_vendor] = 'mysql'
15
- configure_for_mysql
16
- end
17
- %w(development production test staging ci).each do |environment|
18
- src = 'rails/dotenv/web.env.tt'
19
- dest = "roro/containers/app/#{environment}.env"
20
- template src, dest, @config.env
21
- end
22
- end
23
- end
24
- end
25
- end
26
-
@@ -1,45 +0,0 @@
1
- module Roro
2
- class CLI < Thor
3
-
4
- desc "rollon::ruby_gem::with_ci_cd", "Generate files for containerized gem testing, CircleCI, and releasing to RubyGems."
5
- map "rollon::ruby_gem::with_ci_cd" => "rollon_ruby_gem_with_ci_cd"
6
-
7
- def rollon_ruby_gem_with_ci_cd(*args)
8
- ruby_gem_with_ci_cd(*args)
9
- configure_for_rollon
10
- end
11
-
12
- no_commands do
13
- def ruby_gem_with_ci_cd(*args)
14
- answer = ask("\nYou can add your rubygems api key in\n\t
15
- './roro/containers/ruby_gem/ci.env' \n\nlater, or we'll try to add it here:",
16
- default: '')
17
- rubygems_api_key = (answer.eql?("") ? 'some-key' : answer)
18
- @config.env[:rubygems_api_key] = rubygems_api_key
19
- @config.env[:rubies] = []
20
- 3.times do |index|
21
- newruby = @config.env[:ruby_version].gsub('.', '').to_i - index
22
- @config.env[:rubies] << newruby.to_s.split('').join('.')
23
- end
24
- directory 'ruby_gem/roro', './roro', @config.env
25
- directory 'ruby_gem/.circleci', './.circleci', @config.env
26
- copy_file 'ruby_gem/docker-compose.yml', './docker-compose.yml'
27
-
28
- @config.env[:rubies].each do |ruby|
29
- file = '.circleci/config.yml'
30
- spacer = "\n - run: "
31
- rv = "RUBY_VERSION=#{ruby} docker-compose "
32
- build = "build ruby_gem"
33
- up = "up -d --force-recreate ruby_gem"
34
- run_tests = "run ruby_gem bundle exec rake test"
35
- append_to_file file, spacer + rv + run_tests, after: "- placeholder"
36
- append_to_file file, spacer + rv + up, after: "- placeholder"
37
- append_to_file file, spacer + rv + build, after: "- placeholder"
38
- end
39
- gsub_file '.circleci/config.yml', "- placeholder", "- checkout"
40
- append_to_file ".gitignore", "\nGemfile.lock"
41
- gitignore_sensitive_files
42
- end
43
- end
44
- end
45
- end
@@ -1 +0,0 @@
1
- require 'roro/cli/rollon/ruby_gem/with_ci_cd.rb'
@@ -1,2 +0,0 @@
1
- require 'roro/cli/rollon/ruby_gem'
2
- require 'roro/cli/rollon/rails'
@@ -1,137 +0,0 @@
1
- require 'open3'
2
-
3
- module Roro
4
- module Configurator
5
- module Eligibility
6
-
7
- def screen_target_directory
8
- @structure[:greenfield] ? confirm_directory_empty : confirm_directory_app
9
- handle_roro_artifacts
10
- end
11
-
12
- def confirm_directory_app
13
- confirm_dependency({
14
- system_query: "ls -A",
15
- warning: "This is an empty directory. You can generate a new and fully
16
- dockerized Rails app using the 'greenfield' command here here but if
17
- you want to containerize an existing app -- which is what the 'rollon'
18
- command is for -- you'll need to navigate to a directory with an app we
19
- can roll onto.",
20
- suggestion: "$ roro greenfield",
21
- conditional: "!Dir.glob('*').empty?"})
22
- end
23
-
24
- def confirm_directory_empty
25
- confirm = confirm_dependency({
26
- system_query: "ls -A",
27
- warning: "this is not an empty directory. Roro will not greenfield a new Rails app unless either a) the current directory is empty or b) you run greenfield with the --force flag",
28
- suggestion: "$ roro greenfield --force",
29
- conditional: "Dir.glob('*').empty?" # || (Dir.glob('*').size.eql?(1) && Dir.glob('roro_configurator.yml'))"
30
- })
31
- confirm || true
32
- end
33
-
34
- def artifacts?
35
- @appname = @env[:main_app_name]
36
- @artifacts = {}
37
- hash = {
38
- containers: {
39
- list: "docker ps --filter name=#{@appname}\ -a",
40
- remove: " -q | xargs docker stop | xargs docker rm -f"
41
- },
42
- volumes: {
43
- list: "docker volume ls --filter name=#{@appname}*",
44
- remove: " -q | xargs docker volume rm -f"
45
- },
46
- networks: {
47
- list: "docker network ls --filter name=#{@appname}",
48
- remove: " -q | xargs docker network rm"
49
- },
50
- images: {
51
- list: "docker image ls #{@appname}*",
52
- remove: " -q | xargs docker rmi -f"
53
- }
54
- }
55
- hash.each do |k, v|
56
- check = IO.popen(v[:list] + ' -q').count > 0
57
- @artifacts[k] = v if check
58
- end
59
- true if @artifacts.empty?
60
- end
61
-
62
- def handle_roro_artifacts
63
- return if artifacts?
64
- question = [
65
- "\n\nThis machine has some docker artifacts which may clash with ",
66
- "RoRo moving forward. You can verify their existence with:\n"
67
- ]
68
- @artifacts.each { |k,v| question << "\t$ #{v[:list]}" }
69
- question << "\nYou can remove these artifacts with something like:\n"
70
- @artifacts.each { |k,v| question << "\t$ #{v[:list]} #{v[:remove]}" }
71
- question << "\nWould you like RoRo to attempt to remove them for you?"
72
- choices = {'y' => 'Yes', 'n' => 'No'}
73
-
74
- choices.each { |k,v| question << "(#{k}) #{v.to_s}" }
75
-
76
- prompt = question.join
77
- answer = ask(prompt, default: 'y', limited_to: choices.keys)
78
-
79
- if answer.eql?('y')
80
-
81
- @artifacts.each do |k,v|
82
- puts "Attempting to remove #{k}"
83
- system( v[:list] + v[:remove] )
84
- end
85
- end
86
- end
87
-
88
- def confirm_dependency(options)
89
- msg = []
90
- msg << ""
91
- msg << delineator
92
- msg << "It looks like #{options[:warning]}. The following bash command returns false:"
93
- msg << "\t$ #{options[:system_query]}"
94
- msg << "Try this:"
95
- msg << ("\t" + options[:suggestion])
96
- msg << delineator
97
- conditional = options[:conditional] ? eval(options[:conditional]) : system(options[:system_query])
98
- query = options[:system_query]
99
- if conditional == false
100
-
101
- raise(Roro::Error.new(msg.join("\n\n")))
102
- else
103
- true
104
- end
105
- end
106
-
107
- def confirm_dependencies
108
- dependencies.each do |dependency|
109
- confirm_dependency(dependency)
110
- end
111
- end
112
-
113
- private
114
-
115
- def delineator
116
- ("-" * 80)
117
- end
118
-
119
- def dependencies
120
- [
121
- {
122
- system_query: "which docker",
123
- warning: "Docker isn't installed",
124
- suggestion: "https://docs.docker.com/install/"
125
- }, {
126
- system_query: "which docker-compose",
127
- warning: "Docker Compose isn't installed",
128
- suggestion: "https://docs.docker.com/compose/install/"
129
- }, {
130
- system_query: "docker info",
131
- warning: "the Docker daemon isn't running",
132
- suggestion: "https://docs.docker.com/config/daemon/#start-the-daemon-manually"
133
- } ]
134
- end
135
- end
136
- end
137
- end
@@ -1,28 +0,0 @@
1
- require 'yaml'
2
- require 'json'
3
-
4
- module Roro
5
- module Configurator
6
- module Okonomi
7
-
8
- def take_order
9
- ask_questions
10
- end
11
-
12
- def ask_questions
13
- choices = @structure[:choices]
14
- choices.each do |key, value|
15
- @structure[:intentions][key] = ask_question(value)
16
- end
17
- end
18
-
19
- def ask_question(question)
20
- prompt = question[:question]
21
- default = question[:default]
22
- choices = question[:choices].keys
23
- answer = ask(prompt, default: default, limited_to: choices)
24
- answer
25
- end
26
- end
27
- end
28
- end
@@ -1,170 +0,0 @@
1
- module Roro
2
- module Configurator
3
- module Omakase
4
- attr_reader :structure, :intentions, :env, :options, :story
5
-
6
- def initialize(args={}, options={})
7
-
8
- @options = sanitize(args)
9
- @structure = {
10
- intentions: {},
11
- choices: {},
12
- env_vars: {}
13
- }
14
- @story = @options[:story] ? { rollon: @options[:story] } : default_story
15
- build_story
16
- @intentions = @structure[:intentions]
17
- @env = @structure[:env_vars]
18
- @env[:main_app_name] = Dir.pwd.split('/').last
19
- @env[:ruby_version] = RUBY_VERSION
20
- @env[:force] = true
21
- @env[:verbose] = false
22
- @env[:roro_version] = VERSION
23
- screen_target_directory
24
- end
25
-
26
- def build_story
27
- layer_greenfield
28
- layer_rollon
29
- layer_story
30
- layer_okonomi
31
- end
32
-
33
- def layer_okonomi
34
- return unless @options.keys.include?(:okonomi)
35
- @structure[:okonomi] = true
36
- take_order
37
- end
38
-
39
- def layer_greenfield
40
- return unless @options.keys.include?(:greenfield)
41
- @structure[:greenfield] = true
42
- build_layers( { greenfield: :rails } )
43
- end
44
-
45
- def layer_rollon
46
- build_layers(@story)
47
- end
48
-
49
- def layer_story
50
- file = '.roro_story'
51
- return unless File.exist?("#{file}.yml")
52
- overlay(get_layer(file))
53
- end
54
-
55
- def build_layers(story, location=nil)
56
- story = story.is_a?(Hash) ? story : { story => {}}
57
- story.each do |key, value|
58
- location = location ? "#{location}/#{key}" : key
59
- case value
60
- when Array
61
- value.each {|value| build_layers(value, location) }
62
- when true
63
- when
64
- build_layers(value, location)
65
- end
66
- end
67
- overlay(get_layer("#{Roro::CLI.story_root}/#{location}"))
68
- end
69
-
70
- def overlay(layer)
71
- layer.each do |key, value|
72
- @structure[key] ||= value
73
- end
74
- overlay_choices(layer) if layer[:choices]
75
- overlay_env_vars(layer) if layer[:env_vars]
76
- overlay_actions(layer) if layer[:actions]
77
- end
78
-
79
- def overlay_actions(layer)
80
- @structure[:actions].concat(layer[:actions])
81
- end
82
-
83
- def overlay_env_vars(layer)
84
- layer[:env_vars].each do |key, value|
85
- @structure[:env_vars][key] = value
86
- end
87
- end
88
-
89
- def overlay_choices(layer)
90
- @structure[:intentions] ||= {}
91
- layer[:choices].each do |key, value|
92
- @structure[:choices][key] = value
93
- @structure[:intentions][key] = value[:default]
94
- end
95
- end
96
-
97
- def overlay_intentions(layer)
98
- layer[:intentions].each do |key, value|
99
- @structure[:intentions][key] = value
100
- end
101
- end
102
-
103
- def sanitize(options)
104
- options ||= {}
105
- options.transform_keys!{|k| k.to_sym}
106
- options.each do |key, value|
107
- case value
108
- when Array
109
- value.each { |vs| sanitize(vs) }
110
- when Hash
111
- sanitize(value)
112
- when true
113
- options[key] = true
114
- when String || Symbol
115
- options[key] = value.to_sym
116
- end
117
- end
118
- end
119
-
120
- def get_layer(filedir)
121
- filepath = filedir + '.yml'
122
- if !File.exist?(filepath)
123
- key = filedir.split('/').last
124
- error_msg = "Cannot find that story #{key} at #{filepath}. Has it been written?"
125
- raise (Roro::Error.new(error_msg))
126
- end
127
- json = JSON.parse(YAML.load_file(filepath).to_json, symbolize_names: true)
128
- json ? json : ( raise (Roro::Error.new(error_msg)))
129
- end
130
-
131
- def story_map(story='stories')
132
- array ||= []
133
- loc = Roro::CLI.story_root + "/#{story}"
134
- validate_story(loc)
135
- stories = Dir.glob(loc + "/*.yml")
136
- stories.each do |ss|
137
- name = ss.split('/').last.split('.yml').first
138
- array << { name.to_sym => story_map([story, name].join('/'))}
139
- end
140
- array
141
- end
142
-
143
- def default_story(story='rollon', loc=nil)
144
- hash = {}
145
- loc = [(loc ||= Roro::CLI.story_root), story].join('/')
146
- substory = get_layer(loc)[:stories]
147
- if substory.is_a?(Array)
148
- array = []
149
- substory.each do |s|
150
- ss = get_layer([loc, s].join('/'))[:stories]
151
- array << (ss.is_a?(String) ? { s.to_sym => ss.to_sym } : default_story( s, loc ) )
152
- end
153
- hash[story.to_sym] = array
154
- else
155
- hash[story.to_sym] = default_story(substory, loc)
156
- end
157
- hash
158
- end
159
-
160
- def validate_story(story)
161
- substories = get_layer(story)[:stories]
162
- if substories.is_a? String
163
- File.exist?(story + substories + '.yml')
164
- elsif substories.is_a? Array
165
- substories.each { |substory| validate_story(story + '/' + substory) }
166
- end
167
- end
168
- end
169
- end
170
- end