eac_tools 0.102.1 → 0.103.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +42 -34
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +26 -0
  5. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/apache_host.rb +12 -0
  6. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/database.rb +30 -0
  7. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/files.rb +22 -0
  8. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/gitolite.rb +55 -0
  9. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/install.rb +46 -0
  10. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/nodejs.rb +22 -0
  11. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/web.rb +20 -0
  12. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb +59 -0
  13. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/deploy.rb +19 -0
  14. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb +116 -0
  15. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/entity_base.rb +35 -0
  16. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/project.rb +26 -0
  17. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/root.rb +21 -0
  18. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/wiki_page.rb +54 -0
  19. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api.rb +14 -0
  20. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/docker.rb +17 -0
  21. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project/wiki_page/read.rb +27 -0
  22. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project/wiki_page/write.rb +70 -0
  23. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project/wiki_page.rb +30 -0
  24. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project.rb +26 -0
  25. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project_rename.rb +56 -0
  26. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners.rb +14 -0
  27. data/sub/{avm-git/lib/avm/git/runners.rb → avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances.rb} +4 -2
  28. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/base.rb +36 -0
  29. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/core_update.rb +131 -0
  30. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners/core_update.rb +65 -0
  31. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners/docker.rb +19 -0
  32. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners.rb +13 -0
  33. data/sub/{avm-git/lib/avm/git/organize.rb → avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources.rb} +4 -2
  34. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +7 -0
  35. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0.rb +16 -0
  36. data/sub/avm-eac_redmine_base0/locale/en.yml +6 -0
  37. data/sub/avm-eac_redmine_base0/locale/pt-BR.yml +6 -0
  38. data/sub/avm-eac_redmine_base0/spec/lib/avm/eac_redmine_base0/instances/apache_host_spec.rb +22 -0
  39. data/sub/avm-eac_redmine_base0/spec/lib/avm/eac_redmine_base0/instances/apache_host_spec_files/apache_host_spec_no_ssl_content.conf +11 -0
  40. data/sub/avm-eac_redmine_base0/spec/lib/avm/eac_redmine_base0/instances/base/gitolite_spec.rb +26 -0
  41. data/sub/avm-eac_redmine_base0/spec/lib/avm/eac_redmine_base0/instances/base/gitolite_spec_files/config.yml +10 -0
  42. data/sub/avm-eac_redmine_base0/spec/spec_helper.rb +6 -0
  43. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/deploy/config/install.sh.template +45 -0
  44. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/deploy/config/secrets.yml +8 -0
  45. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/Dockerfile.template +36 -0
  46. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_host_dockerfile +8 -0
  47. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_http_virtualhost.conf.template +10 -0
  48. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_https_virtualhost.conf.template +16 -0
  49. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_path_dockerfile +5 -0
  50. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/start.sh.template +52 -0
  51. data/sub/avm-eac_ubuntu_base0/Gemfile +8 -0
  52. data/sub/avm-eac_ubuntu_base0/avm-eac_ubuntu_base0.gemspec +21 -0
  53. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/apache/resource.rb +57 -0
  54. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/apache.rb +24 -0
  55. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/docker_image.rb +31 -0
  56. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/instances/base.rb +24 -0
  57. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/rspec/ssh_docker_server.rb +82 -0
  58. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/runners/base/docker.rb +15 -0
  59. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/runners/base.rb +26 -0
  60. data/sub/{avm-git/lib/avm/git → avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0}/version.rb +2 -2
  61. data/sub/{avm-git/lib/avm/git.rb → avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0.rb} +5 -8
  62. data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/docker_image_spec.rb +12 -0
  63. data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/rspec/ssh_docker_server_spec.rb +11 -0
  64. data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/runners/base/docker_spec.rb +11 -0
  65. data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/runners/base_spec.rb +5 -0
  66. data/sub/avm-eac_ubuntu_base0/spec/rubocop_spec.rb +3 -0
  67. data/sub/{avm-git → avm-eac_ubuntu_base0}/spec/spec_helper.rb +1 -1
  68. data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/docker_image/Dockerfile.template +27 -0
  69. data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/Dockerfile.template +24 -0
  70. data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/id_rsa +27 -0
  71. data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/id_rsa.pub +1 -0
  72. data/sub/eac_docker/Gemfile +8 -0
  73. data/sub/eac_docker/eac_docker.gemspec +20 -0
  74. data/sub/eac_docker/lib/eac_docker/container.rb +83 -0
  75. data/sub/eac_docker/lib/eac_docker/debug.rb +13 -0
  76. data/sub/eac_docker/lib/eac_docker/executables.rb +15 -0
  77. data/sub/eac_docker/lib/eac_docker/images/base.rb +11 -0
  78. data/sub/eac_docker/lib/eac_docker/images/coded.rb +39 -0
  79. data/sub/eac_docker/lib/eac_docker/images/named.rb +26 -0
  80. data/sub/eac_docker/lib/eac_docker/images/templatized.rb +43 -0
  81. data/sub/eac_docker/lib/eac_docker/registry.rb +15 -0
  82. data/sub/eac_docker/lib/eac_docker/rspec/setup.rb +15 -0
  83. data/sub/eac_docker/lib/eac_docker/rspec/stub_image.rb +39 -0
  84. data/sub/eac_docker/lib/eac_docker/version.rb +5 -0
  85. data/sub/eac_docker/lib/eac_docker.rb +9 -0
  86. data/sub/eac_docker/spec/lib/eac_docker/executables_spec.rb +7 -0
  87. data/sub/eac_docker/spec/lib/eac_docker/images/coded_spec.rb +10 -0
  88. data/sub/eac_docker/spec/lib/eac_docker/images/coded_spec_files/image1/Dockerfile +1 -0
  89. data/sub/eac_docker/spec/lib/eac_docker/images/templatized_spec.rb +15 -0
  90. data/sub/eac_docker/spec/lib/eac_docker/images/templatized_spec_files/stub_docker_image/Dockerfile +1 -0
  91. data/sub/eac_docker/spec/rubocop_spec.rb +3 -0
  92. data/sub/eac_docker/spec/spec_helper.rb +5 -0
  93. metadata +101 -134
  94. data/sub/avm-git/avm-git.gemspec +0 -25
  95. data/sub/avm-git/lib/avm/git/application_scms/base/assert_main_at.rb +0 -44
  96. data/sub/avm-git/lib/avm/git/application_scms/base.rb +0 -18
  97. data/sub/avm-git/lib/avm/git/application_scms.rb +0 -9
  98. data/sub/avm-git/lib/avm/git/commit/class_methods.rb +0 -29
  99. data/sub/avm-git/lib/avm/git/commit/diff_tree_line.rb +0 -32
  100. data/sub/avm-git/lib/avm/git/commit/file.rb +0 -42
  101. data/sub/avm-git/lib/avm/git/commit.rb +0 -57
  102. data/sub/avm-git/lib/avm/git/issue/complete/commits.rb +0 -40
  103. data/sub/avm-git/lib/avm/git/issue/complete/git_subrepos.rb +0 -20
  104. data/sub/avm-git/lib/avm/git/issue/complete/local_branch.rb +0 -59
  105. data/sub/avm-git/lib/avm/git/issue/complete/local_tag.rb +0 -37
  106. data/sub/avm-git/lib/avm/git/issue/complete/push.rb +0 -60
  107. data/sub/avm-git/lib/avm/git/issue/complete/remote.rb +0 -33
  108. data/sub/avm-git/lib/avm/git/issue/complete/test.rb +0 -34
  109. data/sub/avm-git/lib/avm/git/issue/complete/tracker.rb +0 -21
  110. data/sub/avm-git/lib/avm/git/issue/complete/validation.rb +0 -36
  111. data/sub/avm-git/lib/avm/git/issue/complete/validations.rb +0 -54
  112. data/sub/avm-git/lib/avm/git/issue/complete/working_tree.rb +0 -19
  113. data/sub/avm-git/lib/avm/git/issue/complete.rb +0 -66
  114. data/sub/avm-git/lib/avm/git/issue.rb +0 -10
  115. data/sub/avm-git/lib/avm/git/launcher/base/class_methods.rb +0 -28
  116. data/sub/avm-git/lib/avm/git/launcher/base/dirty_files.rb +0 -21
  117. data/sub/avm-git/lib/avm/git/launcher/base/remotes.rb +0 -37
  118. data/sub/avm-git/lib/avm/git/launcher/base/subrepo.rb +0 -42
  119. data/sub/avm-git/lib/avm/git/launcher/base/underlying.rb +0 -54
  120. data/sub/avm-git/lib/avm/git/launcher/base.rb +0 -81
  121. data/sub/avm-git/lib/avm/git/launcher/error.rb +0 -13
  122. data/sub/avm-git/lib/avm/git/launcher/mirror_update.rb +0 -36
  123. data/sub/avm-git/lib/avm/git/launcher/publish_base.rb +0 -127
  124. data/sub/avm-git/lib/avm/git/launcher/remote.rb +0 -53
  125. data/sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb +0 -36
  126. data/sub/avm-git/lib/avm/git/launcher/warp_base.rb +0 -63
  127. data/sub/avm-git/lib/avm/git/launcher_stereotypes/git/local_project_mixin.rb +0 -16
  128. data/sub/avm-git/lib/avm/git/launcher_stereotypes/git/publish.rb +0 -13
  129. data/sub/avm-git/lib/avm/git/launcher_stereotypes/git/warp.rb +0 -25
  130. data/sub/avm-git/lib/avm/git/launcher_stereotypes/git.rb +0 -22
  131. data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subrepo/publish.rb +0 -29
  132. data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subrepo/warp.rb +0 -82
  133. data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subrepo.rb +0 -32
  134. data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subtree/publish.rb +0 -12
  135. data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subtree/warp.rb +0 -29
  136. data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subtree.rb +0 -47
  137. data/sub/avm-git/lib/avm/git/launcher_stereotypes/provider.rb +0 -17
  138. data/sub/avm-git/lib/avm/git/launcher_stereotypes.rb +0 -9
  139. data/sub/avm-git/lib/avm/git/organize/reference_update.rb +0 -32
  140. data/sub/avm-git/lib/avm/git/organize/repository.rb +0 -74
  141. data/sub/avm-git/lib/avm/git/revision_test.rb +0 -102
  142. data/sub/avm-git/lib/avm/git/runners/base/commit.rb +0 -96
  143. data/sub/avm-git/lib/avm/git/runners/base/deploy.rb +0 -108
  144. data/sub/avm-git/lib/avm/git/runners/base/dirty_files.rb +0 -42
  145. data/sub/avm-git/lib/avm/git/runners/base/organize.rb +0 -72
  146. data/sub/avm-git/lib/avm/git/runners/base/revisions_test.rb +0 -63
  147. data/sub/avm-git/lib/avm/git/runners/base/subrepo/check.rb +0 -45
  148. data/sub/avm-git/lib/avm/git/runners/base/subrepo/clone.rb +0 -80
  149. data/sub/avm-git/lib/avm/git/runners/base/subrepo/fix.rb +0 -69
  150. data/sub/avm-git/lib/avm/git/runners/base/subrepo.rb +0 -17
  151. data/sub/avm-git/lib/avm/git/runners/base.rb +0 -40
  152. data/sub/avm-git/lib/avm/git/scms/git/branch.rb +0 -28
  153. data/sub/avm-git/lib/avm/git/scms/git/branches.rb +0 -17
  154. data/sub/avm-git/lib/avm/git/scms/git/change_tracker.rb +0 -34
  155. data/sub/avm-git/lib/avm/git/scms/git/changed_file.rb +0 -25
  156. data/sub/avm-git/lib/avm/git/scms/git/changed_files.rb +0 -21
  157. data/sub/avm-git/lib/avm/git/scms/git/commit/deploy.rb +0 -37
  158. data/sub/avm-git/lib/avm/git/scms/git/commit/deploy_methods.rb +0 -24
  159. data/sub/avm-git/lib/avm/git/scms/git/commit.rb +0 -64
  160. data/sub/avm-git/lib/avm/git/scms/git/commit_dirty.rb +0 -32
  161. data/sub/avm-git/lib/avm/git/scms/git/commits.rb +0 -44
  162. data/sub/avm-git/lib/avm/git/scms/git/interval.rb +0 -28
  163. data/sub/avm-git/lib/avm/git/scms/git/milestones.rb +0 -18
  164. data/sub/avm-git/lib/avm/git/scms/git/remote.rb +0 -18
  165. data/sub/avm-git/lib/avm/git/scms/git/remotes.rb +0 -29
  166. data/sub/avm-git/lib/avm/git/scms/git/run_commit.rb +0 -54
  167. data/sub/avm-git/lib/avm/git/scms/git.rb +0 -46
  168. data/sub/avm-git/lib/avm/git/scms/git_sub_base/changed_file.rb +0 -19
  169. data/sub/avm-git/lib/avm/git/scms/git_sub_base/commit.rb +0 -23
  170. data/sub/avm-git/lib/avm/git/scms/git_sub_base/interval.rb +0 -23
  171. data/sub/avm-git/lib/avm/git/scms/git_sub_base.rb +0 -30
  172. data/sub/avm-git/lib/avm/git/scms/git_subrepo.rb +0 -33
  173. data/sub/avm-git/lib/avm/git/scms/git_subtree.rb +0 -29
  174. data/sub/avm-git/lib/avm/git/scms/provider.rb +0 -16
  175. data/sub/avm-git/lib/avm/git/scms.rb +0 -9
  176. data/sub/avm-git/lib/avm/git/subrepo_check/parent.rb +0 -48
  177. data/sub/avm-git/lib/avm/git/subrepo_check/remote.rb +0 -86
  178. data/sub/avm-git/lib/avm/git/subrepo_check/show_result.rb +0 -30
  179. data/sub/avm-git/lib/avm/git/subrepo_check.rb +0 -36
  180. data/sub/avm-git/lib/avm/git/subrepo_checks.rb +0 -57
  181. data/sub/avm-git/lib/avm/git/vendor/github.rb +0 -20
  182. data/sub/avm-git/lib/avm/git/vendor.rb +0 -9
  183. data/sub/avm-git/locale/en.yml +0 -6
  184. data/sub/avm-git/locale/pt-BR.yml +0 -6
  185. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec.rb +0 -13
  186. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/add.source.out +0 -1
  187. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/add.target.yaml +0 -7
  188. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/modify.source.out +0 -1
  189. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/modify.target.yaml +0 -7
  190. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/remove.source.out +0 -1
  191. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/remove.target.yaml +0 -7
  192. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename.source.out +0 -2
  193. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename.target.yaml +0 -13
  194. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename_modify.source.out +0 -2
  195. data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename_modify.target.yaml +0 -13
  196. data/sub/avm-git/spec/lib/avm/git/commit_spec.rb +0 -56
  197. data/sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb +0 -45
  198. data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/publish_spec.rb +0 -83
  199. data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/publish_spec_files/config.yml +0 -5
  200. data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/publish_spec_settings.yml +0 -6
  201. data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec.rb +0 -53
  202. data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec_files/config.yml +0 -3
  203. data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec_settings.yml +0 -6
  204. data/sub/avm-git/spec/lib/avm/git/runners/base/deploy_spec.rb +0 -126
  205. data/sub/avm-git/spec/lib/avm/git/runners/base/deploy_spec_files/append1/stub3.txt.template +0 -1
  206. data/sub/avm-git/spec/lib/avm/git/runners/base/deploy_spec_files/append2/stub4.txt +0 -1
  207. data/sub/avm-git/spec/lib/avm/git/scms/git/commit/deploy_spec.rb +0 -92
  208. data/sub/avm-git/spec/lib/avm/git/scms/git_spec.rb +0 -8
  209. data/sub/avm-git/spec/lib/avm/git/scms/git_subrepo_spec.rb +0 -8
  210. data/sub/avm-git/spec/lib/avm/git/vendor/github_spec.rb +0 -23
  211. /data/sub/{avm-git → avm-eac_redmine_base0}/Gemfile +0 -0
  212. /data/sub/{avm-git → avm-eac_redmine_base0}/spec/rubocop_spec.rb +0 -0
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_redmine_base0/instances/rest_api/entity_base'
4
+ require 'avm/eac_redmine_base0/instances/rest_api/wiki_page'
5
+ require 'eac_rest/api'
6
+ require 'eac_ruby_utils/core_ext'
7
+
8
+ module Avm
9
+ module EacRedmineBase0
10
+ module Instances
11
+ class RestApi < ::EacRest::Api
12
+ class Project < ::Avm::EacRedmineBase0::Instances::RestApi::EntityBase
13
+ # @return [String]
14
+ def prefix
15
+ "/projects/#{id}"
16
+ end
17
+
18
+ # @return [Avm::EacRedmineBase0::Instances::RestApi::WikiPage]
19
+ def wiki_page(name)
20
+ child_entity(::Avm::EacRedmineBase0::Instances::RestApi::WikiPage, name)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_redmine_base0/instances/rest_api/entity_base'
4
+ require 'eac_rest/api'
5
+ require 'eac_ruby_utils/core_ext'
6
+
7
+ module Avm
8
+ module EacRedmineBase0
9
+ module Instances
10
+ class RestApi < ::EacRest::Api
11
+ class Root < ::Avm::EacRedmineBase0::Instances::RestApi::EntityBase
12
+ # @param id_or_identifier [String]
13
+ # @return [Avm::EacRedmineBase0::Instances::RestApi::Project]
14
+ def project(id_or_identifier)
15
+ api.entity(::Avm::EacRedmineBase0::Instances::RestApi::Project, id_or_identifier)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_redmine_base0/instances/rest_api/entity_base'
4
+ require 'eac_rest/api'
5
+ require 'eac_ruby_utils/core_ext'
6
+
7
+ module Avm
8
+ module EacRedmineBase0
9
+ module Instances
10
+ class RestApi < ::EacRest::Api
11
+ class WikiPage < ::Avm::EacRedmineBase0::Instances::RestApi::EntityBase
12
+ enable_simple_cache
13
+
14
+ # @return [Hash]
15
+ def data_from_id
16
+ fetch_data(prefix)
17
+ end
18
+
19
+ # @return [String]
20
+ def data_root
21
+ 'wiki_page'
22
+ end
23
+
24
+ # @return [String]
25
+ def prefix
26
+ "#{parent_entity.prefix}/wiki/#{id}"
27
+ end
28
+
29
+ # @return [String]
30
+ def read
31
+ data.fetch(data_root).fetch('text')
32
+ end
33
+
34
+ # @param content [String]
35
+ # @return [+self+]
36
+ def write(text)
37
+ data_from_response(
38
+ build_request(prefix).verb(:put).header('Content-type', 'application/json')
39
+ .body_data(write_data(text).to_json).response
40
+ )
41
+ end
42
+
43
+ # @param text [String]
44
+ # @return [Hash]
45
+ def write_data(text)
46
+ {
47
+ data_root => { 'text' => text }
48
+ }
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'eac_rest/api'
5
+
6
+ module Avm
7
+ module EacRedmineBase0
8
+ module Instances
9
+ class RestApi < ::EacRest::Api
10
+ require_sub __FILE__
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/docker/runner'
4
+
5
+ module Avm
6
+ module EacRedmineBase0
7
+ module Instances
8
+ module Runners
9
+ class Docker < ::Avm::Docker::Runner
10
+ def use_default_registry?
11
+ false
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/core_ext'
4
+
5
+ module Avm
6
+ module EacRedmineBase0
7
+ module Instances
8
+ module Runners
9
+ class Project
10
+ class WikiPage
11
+ class Read
12
+ runner_with :help, :output
13
+
14
+ def run
15
+ run_output
16
+ end
17
+
18
+ def output_content
19
+ runner_context.call(:wiki_page_content)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/core_ext'
4
+
5
+ module Avm
6
+ module EacRedmineBase0
7
+ module Instances
8
+ module Runners
9
+ class Project
10
+ class WikiPage
11
+ class Write
12
+ runner_with :help, :confirmation, :input do
13
+ bool_opt '-f', '--force'
14
+ end
15
+ delegate :force?, to: :parsed
16
+
17
+ def run
18
+ start_banner
19
+ if write?
20
+ run_write
21
+ else
22
+ success 'Content unchanged, no further action will be taken'
23
+ end
24
+ end
25
+
26
+ def start_banner
27
+ infov 'Content'
28
+ infov ' * Current', current_content
29
+ infov ' * New', new_content
30
+ infov ' * Changed?', content_changed?
31
+ end
32
+
33
+ # @return [Boolean]
34
+ def content_changed?
35
+ new_content != current_content
36
+ end
37
+
38
+ def run_write
39
+ if confirm?('Write?')
40
+ infom 'Writing...'
41
+ runner_context.call(:wiki_page).write(new_content)
42
+ success('Writed!')
43
+ else
44
+ success('Unconfirmed, no further action will be taken')
45
+ end
46
+ end
47
+
48
+ # @return [Boolean]
49
+ def write?
50
+ parsed.force? || content_changed?
51
+ end
52
+
53
+ private
54
+
55
+ # @return [String]
56
+ def current_content_uncached
57
+ runner_context.call(:wiki_page_content)
58
+ end
59
+
60
+ # @return [String]
61
+ def new_content_uncached
62
+ input_content
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/core_ext'
4
+
5
+ module Avm
6
+ module EacRedmineBase0
7
+ module Instances
8
+ module Runners
9
+ class Project
10
+ class WikiPage
11
+ runner_with :help, :subcommands do
12
+ pos_arg :name
13
+ subcommands
14
+ end
15
+
16
+ def wiki_page
17
+ runner_context.call(:project).wiki_page(parsed.name)
18
+ end
19
+
20
+ def wiki_page_content
21
+ wiki_page.read
22
+ end
23
+
24
+ require_sub __FILE__
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/core_ext'
4
+
5
+ module Avm
6
+ module EacRedmineBase0
7
+ module Instances
8
+ module Runners
9
+ class Project
10
+ runner_with :help, :subcommands do
11
+ pos_arg :id_or_identifier
12
+ subcommands
13
+ end
14
+
15
+ private
16
+
17
+ def project_uncached
18
+ runner_context.call(:instance).rest_api.root_entity.project(parsed.id_or_identifier)
19
+ end
20
+
21
+ require_sub __FILE__
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/core_ext'
4
+ require 'avm/eac_rails_base1/instances/runners/code_runner'
5
+
6
+ module Avm
7
+ module EacRedmineBase0
8
+ module Instances
9
+ module Runners
10
+ class ProjectRename
11
+ runner_with :help, ::Avm::EacRailsBase1::RunnerWith::Bundle do
12
+ pos_arg :from
13
+ pos_arg :to
14
+ end
15
+
16
+ def run
17
+ bundle_run
18
+ end
19
+
20
+ def start_banner
21
+ infov 'From', from
22
+ infov 'To', to
23
+ end
24
+
25
+ delegate :from, :to, to: :parsed
26
+
27
+ def bundle_args
28
+ %w[exec rails runner] + [code]
29
+ end
30
+
31
+ def code
32
+ <<~CODE
33
+ from_arg = '#{from}'
34
+ to_arg = '#{to}'
35
+ project = ::Project.where(identifier: from_arg).first
36
+ if project.present?
37
+ puts "Project found: \#{project}"
38
+ puts "Renaming..."
39
+ project.update_column(:identifier, to_arg)
40
+ puts "Renamed. Testing..."
41
+ project = ::Project.where(identifier: to_arg).first
42
+ if project
43
+ puts "Project found: \#{project}"
44
+ else
45
+ fail "After rename: project not found with identifier \\"\#{to_arg}\\""
46
+ end
47
+ else
48
+ fail "Before rename: project not found with identifier \\"\#{from_arg}\\""
49
+ end
50
+ CODE
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_redmine_base0/instances/deploy'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module EacRedmineBase0
8
+ module Instances
9
+ module Runners
10
+ require_sub __FILE__
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,8 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'eac_ruby_utils/core_ext'
4
+
3
5
  module Avm
4
- module Git
5
- module Runners
6
+ module EacRedmineBase0
7
+ module Instances
6
8
  require_sub __FILE__
7
9
  end
8
10
  end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_rails_base1/sources/base'
4
+ require 'avm/eac_redmine_base0/sources/runners'
5
+ require 'eac_ruby_utils/core_ext'
6
+
7
+ module Avm
8
+ module EacRedmineBase0
9
+ module Sources
10
+ class Base < ::Avm::EacRailsBase1::Sources::Base
11
+ DEFAULT_TEST_COMMANDS = {}.freeze
12
+ REDMINE_LIB_SUBPATH = 'lib/redmine.rb'
13
+ SUBS_INCLUDE_PATHS_DEFAULT = ['plugins/*'].freeze
14
+
15
+ # Return a empty hash (No tests).
16
+ #
17
+ # @return [Hash<String, EacRubyUtils::Envs::Command].
18
+ def default_test_commands
19
+ DEFAULT_TEST_COMMANDS
20
+ end
21
+
22
+ def redmine_lib_path
23
+ path.join(REDMINE_LIB_SUBPATH)
24
+ end
25
+
26
+ def subs_include_paths_default
27
+ SUBS_INCLUDE_PATHS_DEFAULT
28
+ end
29
+
30
+ def valid?
31
+ super && redmine_lib_path.exist?
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,131 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_redmine_base0/sources/core_update'
4
+ require 'avm/sources/base/configuration'
5
+ require 'avm/sync'
6
+ require 'eac_fs/cached_download'
7
+ require 'eac_ruby_utils/core_ext'
8
+
9
+ module Avm
10
+ module EacRedmineBase0
11
+ module Sources
12
+ class CoreUpdate
13
+ enable_speaker
14
+ enable_simple_cache
15
+ common_constructor :source, :version, :url
16
+
17
+ GITIGNORE_ADD = %w[/public/assets/**/* /config/install.sh /config/secrets_key.txt
18
+ /log/**/*].freeze
19
+ GITIGNORE_DEL = %w[/Gemfile.lock /plugins/* /public/themes/*].freeze
20
+ TARGET_KEEP = ::Avm::Sources::Base::Configuration::CONFIGURATION_FILENAMES
21
+ .map { |b| "/#{b}" } + %w[/Gemfile.lock /plugins/*/**
22
+ /public/themes/*/**].freeze
23
+ TARGET_REMOVE = %w[alternate classic].map { |t| "/public/themes/#{t}/**" }
24
+
25
+ def run
26
+ ::EacRubyUtils::Fs::Temp.on_directory do |dir|
27
+ @tempdir = dir
28
+ assert_source_package
29
+ extract_package_to_tempdir
30
+ sync_content
31
+ change_git_ignore
32
+ validate_empty_dir
33
+ end
34
+ git_commit
35
+ success 'Done!'
36
+ end
37
+
38
+ def assert_source_package
39
+ infom 'Asserting source package...'
40
+ source_package.assert
41
+ infov 'Package cache path', source_package.path
42
+ infov 'Package size', source_package.path.size
43
+ end
44
+
45
+ def fs_object_id
46
+ [source.path, version].join('_').variableize
47
+ end
48
+
49
+ private
50
+
51
+ attr_reader :tempdir
52
+
53
+ def change_git_ignore
54
+ file = target_path.join('.gitignore')
55
+ file.write(
56
+ (file.read.each_line.map(&:strip).reject { |line| GITIGNORE_DEL.include?(line) } +
57
+ ['', '#eac_redmine_base0'] + GITIGNORE_ADD).map { |line| "#{line}\n" }.join
58
+ )
59
+ end
60
+
61
+ def extract_package_to_tempdir
62
+ infom "Extracting package to tempdir #{tempdir}..."
63
+ ::EacRubyUtils::Envs.local.command(
64
+ 'tar', '-xf', source_package.path.to_path, '-C', tempdir.to_path,
65
+ '--strip-components', '1'
66
+ ).execute!
67
+ end
68
+
69
+ def git_commit
70
+ if git_repo.dirty?
71
+ infom 'Git commiting...'
72
+ git_repo.command('add', '--', target_path).execute!
73
+ git_repo.command('commit', '-m', git_commit_message, '--', target_path).execute!
74
+ else
75
+ infom 'Nothing to commit'
76
+ end
77
+ end
78
+
79
+ def git_commit_message
80
+ i18n_translate(__method__, version: version, __locale: source.locale)
81
+ end
82
+
83
+ def git_repo_uncached
84
+ ::EacGit::Local.new(target_path)
85
+ end
86
+
87
+ def sync_content
88
+ ::Avm::Sync.new(source_path, target_path)
89
+ .add_exclude('/*').add_includes(*target_files_to_remove).move_mode(true).run
90
+ end
91
+
92
+ # @return [EacFs::CachedDownload]
93
+ def source_package_uncached
94
+ ::EacFs::CachedDownload.new(url, fs_cache)
95
+ end
96
+
97
+ def validate_empty_dir
98
+ if source_path.children.empty?
99
+ infom 'No content left in source directory'
100
+ else
101
+ fatal_error 'Found entries in source directory: ' + # rubocop:disable Style/StringConcatenation
102
+ source_path.children.map { |c| c.basename.to_path }.join(', ')
103
+ end
104
+ end
105
+
106
+ def source_path_uncached
107
+ ::Pathname.new(tempdir.to_path)
108
+ end
109
+
110
+ # @return [Enumerable<String>]
111
+ def target_files_to_remove
112
+ git_repo.command('ls-files').execute!
113
+ .each_line.map { |v| "/#{v.strip}" }
114
+ .reject { |tpath| target_keep?(tpath) }
115
+ end
116
+
117
+ # @param tpath [String]
118
+ # @return [Boolean]
119
+ def target_keep?(tpath)
120
+ tpath = tpath.to_pathname
121
+ TARGET_REMOVE.none? { |target_remove| tpath.fnmatch?(target_remove) }
122
+ TARGET_KEEP.any? { |target_keep| tpath.fnmatch?(target_keep) }
123
+ end
124
+
125
+ def target_path_uncached
126
+ source.path
127
+ end
128
+ end
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_rails_base1/sources/base'
4
+ require 'avm/eac_redmine_base0/sources/core_update'
5
+ require 'eac_cli/core_ext'
6
+
7
+ module Avm
8
+ module EacRedmineBase0
9
+ module Sources
10
+ module Runners
11
+ class CoreUpdate
12
+ runner_with :help do
13
+ arg_opt '-u', '--url', 'Core\'s package URL.'
14
+ arg_opt '-v', '--version', 'Core\'s version.'
15
+ desc 'Update instance\' core.'
16
+ end
17
+
18
+ def run
19
+ start_banner
20
+ validate
21
+ update
22
+ end
23
+
24
+ private
25
+
26
+ def start_banner
27
+ infov 'URL', url
28
+ infov 'Version', version
29
+ end
30
+
31
+ def update
32
+ ::Avm::EacRedmineBase0::Sources::CoreUpdate
33
+ .new(runner_context.call(:subject), version, url).run
34
+ end
35
+
36
+ def url
37
+ parsed.url || url_by_version
38
+ end
39
+
40
+ def url_by_version
41
+ parsed.version.if_present do |v|
42
+ "https://www.redmine.org/releases/redmine-#{v}.tar.gz"
43
+ end
44
+ end
45
+
46
+ def validate
47
+ %w[url version].each do |attr|
48
+ fatal_error "\"#{attr}\" is blank. See avaiable options." if send(attr).blank?
49
+ end
50
+ end
51
+
52
+ def version
53
+ parsed.version || version_by_url
54
+ end
55
+
56
+ def version_by_url
57
+ parsed.url.if_present do |v|
58
+ /(\d+.\d+.\d+)/.if_match(v, false) { |m| m[1] }
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_generic_base0/sources/docker/runner'
4
+ require 'avm/eac_ubuntu_base0/docker_image'
5
+
6
+ module Avm
7
+ module EacRedmineBase0
8
+ module Sources
9
+ module Runners
10
+ class Docker < ::Avm::EacGenericBase0::Sources::Docker::Runner
11
+ # @return [Avm::EacUbuntuBase0::DockerImage]
12
+ def docker_image
13
+ ::Avm::EacUbuntuBase0::DockerImage.new
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRedmineBase0
7
+ module Sources
8
+ module Runners
9
+ require_sub __FILE__
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,8 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'eac_ruby_utils/core_ext'
4
+
3
5
  module Avm
4
- module Git
5
- module Organize
6
+ module EacRedmineBase0
7
+ module Sources
6
8
  require_sub __FILE__
7
9
  end
8
10
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module EacRedmineBase0
5
+ VERSION = '0.23.0'
6
+ end
7
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils'
4
+ EacRubyUtils::RootModuleSetup.perform __FILE__
5
+
6
+ module Avm
7
+ module EacRedmineBase0
8
+ end
9
+ end
10
+
11
+ require 'avm'
12
+ require 'avm/eac_generic_base0'
13
+ require 'avm/eac_rails_base1'
14
+ require 'avm/eac_ubuntu_base0'
15
+ require 'eac_fs'
16
+ require 'eac_rest'