avm-tools 0.56.0 → 0.60.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/local_projects.rb +9 -0
  3. data/lib/avm/local_projects/instance.rb +35 -0
  4. data/lib/avm/local_projects/jobs/update.rb +29 -0
  5. data/lib/avm/projects.rb +9 -0
  6. data/lib/avm/projects/stereotype.rb +62 -0
  7. data/lib/avm/projects/stereotypes.rb +20 -0
  8. data/lib/avm/projects/stereotypes/git.rb +25 -0
  9. data/lib/avm/projects/stereotypes/git/local_project_mixin.rb +19 -0
  10. data/lib/avm/projects/stereotypes/git/publish.rb +15 -0
  11. data/lib/avm/projects/stereotypes/git/warp.rb +27 -0
  12. data/lib/avm/projects/stereotypes/git_subrepo.rb +34 -0
  13. data/lib/avm/projects/stereotypes/git_subrepo/publish.rb +14 -0
  14. data/lib/avm/projects/stereotypes/git_subrepo/warp.rb +87 -0
  15. data/lib/avm/projects/stereotypes/git_subtree.rb +51 -0
  16. data/lib/avm/projects/stereotypes/git_subtree/publish.rb +12 -0
  17. data/lib/avm/projects/stereotypes/git_subtree/warp.rb +29 -0
  18. data/lib/avm/projects/stereotypes/rails_application.rb +23 -0
  19. data/lib/avm/projects/stereotypes/redmine_plugin.rb +23 -0
  20. data/lib/avm/projects/stereotypes/ruby_gem.rb +30 -0
  21. data/lib/avm/projects/stereotypes/ruby_gem/local_project_mixin.rb +19 -0
  22. data/lib/avm/projects/stereotypes/ruby_gem/publish.rb +129 -0
  23. data/lib/avm/projects/stereotypes/ruby_gem/update.rb +59 -0
  24. data/lib/avm/tools/runner/eac_redmine_base0/project_rename.rb +64 -0
  25. data/lib/avm/tools/runner/launcher.rb +10 -2
  26. data/lib/avm/tools/runner/launcher/instances.rb +45 -0
  27. data/lib/avm/tools/runner/launcher/projects.rb +50 -0
  28. data/lib/avm/tools/runner/launcher/publish.rb +65 -0
  29. data/lib/avm/tools/runner/local_project.rb +32 -0
  30. data/lib/avm/tools/runner/local_project/info.rb +25 -0
  31. data/lib/avm/tools/runner/local_project/update.rb +26 -0
  32. data/lib/avm/tools/version.rb +1 -1
  33. data/lib/eac_launcher.rb +1 -2
  34. data/lib/eac_launcher/context/instance_manager.rb +1 -0
  35. data/lib/eac_launcher/git/base/dirty_files.rb +5 -14
  36. data/lib/eac_launcher/git/publish_base.rb +1 -0
  37. data/lib/eac_launcher/git/sub_warp_base.rb +1 -1
  38. data/lib/eac_launcher/git/warp_base.rb +2 -2
  39. data/lib/eac_launcher/instances/base.rb +2 -2
  40. data/lib/eac_launcher/instances/runner_helper.rb +1 -1
  41. data/lib/eac_launcher/paths/logical.rb +2 -2
  42. data/vendor/eac_docker/Gemfile +5 -0
  43. data/vendor/eac_docker/eac_docker.gemspec +18 -0
  44. data/vendor/eac_docker/lib/eac_docker.rb +7 -0
  45. data/vendor/eac_docker/lib/eac_docker/container.rb +74 -0
  46. data/vendor/eac_docker/lib/eac_docker/executables.rb +18 -0
  47. data/vendor/eac_docker/lib/eac_docker/images.rb +9 -0
  48. data/vendor/eac_docker/lib/eac_docker/images/base.rb +14 -0
  49. data/vendor/eac_docker/lib/eac_docker/images/coded.rb +39 -0
  50. data/vendor/eac_docker/lib/eac_docker/images/named.rb +30 -0
  51. data/vendor/eac_docker/lib/eac_docker/images/templatized.rb +26 -0
  52. data/vendor/eac_docker/lib/eac_docker/registry.rb +17 -0
  53. data/vendor/eac_docker/lib/eac_docker/rspec.rb +17 -0
  54. data/vendor/eac_docker/lib/eac_docker/version.rb +5 -0
  55. data/vendor/eac_docker/spec/lib/eac_docker/executables_spec.rb +9 -0
  56. data/vendor/eac_docker/spec/lib/eac_docker/images/coded_spec.rb +12 -0
  57. data/vendor/eac_docker/spec/lib/eac_docker/images/coded_spec_files/image1/Dockerfile +1 -0
  58. data/vendor/eac_docker/spec/lib/eac_docker/images/templatized_spec.rb +17 -0
  59. data/vendor/eac_docker/spec/lib/eac_docker/images/templatized_spec_files/stub_docker_image/Dockerfile +1 -0
  60. data/vendor/eac_docker/spec/rubocop_spec.rb +7 -0
  61. data/vendor/eac_docker/spec/spec_helper.rb +103 -0
  62. data/vendor/eac_git/lib/eac_git/local.rb +1 -1
  63. data/vendor/eac_git/lib/eac_git/local/dirty_files.rb +38 -0
  64. data/vendor/eac_git/lib/eac_git/version.rb +1 -1
  65. data/vendor/eac_git/vendor/git-subrepo/lib/git-subrepo.d/bash+.bash +1 -1
  66. data/vendor/eac_ruby_gems_utils/LICENCE +16 -674
  67. data/vendor/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +10 -2
  68. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem.rb +2 -1
  69. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
  70. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/boolean.rb +31 -0
  71. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_class_methods.rb +1 -1
  72. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env.rb +12 -9
  73. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env/dasho_options.rb +53 -0
  74. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env/identity_file.rb +25 -0
  75. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env/quiet.rb +24 -0
  76. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/ssh_env/terminal.rb +34 -0
  77. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs_cache.rb +1 -0
  78. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/immutable.rb +15 -0
  79. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/immutable/array_accessor.rb +32 -0
  80. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/immutable/base_accessor.rb +23 -0
  81. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/immutable/boolean_accessor.rb +16 -0
  82. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/immutable/class_methods.rb +20 -0
  83. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/immutable/common_accessor.rb +30 -0
  84. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/immutable/hash_accessor.rb +46 -0
  85. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/immutable/instance_methods.rb +21 -0
  86. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +5 -0
  87. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/immutable.rb +10 -0
  88. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/require_sub.rb +8 -8
  89. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  90. metadata +91 -27
  91. data/lib/eac_launcher/runner.rb +0 -21
  92. data/lib/eac_launcher/runner/instances.rb +0 -41
  93. data/lib/eac_launcher/runner/projects.rb +0 -46
  94. data/lib/eac_launcher/runner/publish.rb +0 -59
  95. data/lib/eac_launcher/stereotype.rb +0 -52
  96. data/lib/eac_launcher/stereotypes.rb +0 -14
  97. data/lib/eac_launcher/stereotypes/git.rb +0 -21
  98. data/lib/eac_launcher/stereotypes/git/publish.rb +0 -13
  99. data/lib/eac_launcher/stereotypes/git/warp.rb +0 -25
  100. data/lib/eac_launcher/stereotypes/git_subrepo.rb +0 -30
  101. data/lib/eac_launcher/stereotypes/git_subrepo/publish.rb +0 -12
  102. data/lib/eac_launcher/stereotypes/git_subrepo/warp.rb +0 -85
  103. data/lib/eac_launcher/stereotypes/git_subtree.rb +0 -47
  104. data/lib/eac_launcher/stereotypes/git_subtree/publish.rb +0 -10
  105. data/lib/eac_launcher/stereotypes/git_subtree/warp.rb +0 -27
  106. data/lib/eac_launcher/stereotypes/rails.rb +0 -21
  107. data/lib/eac_launcher/stereotypes/redmine_plugin.rb +0 -21
  108. data/lib/eac_launcher/stereotypes/ruby_gem.rb +0 -27
  109. data/lib/eac_launcher/stereotypes/ruby_gem/publish.rb +0 -127
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_launcher/ruby/gem/specification'
4
- require 'eac_launcher/stereotype'
5
- require 'eac_launcher/stereotypes/ruby_gem/publish'
6
-
7
- module EacLauncher
8
- module Stereotypes
9
- class RubyGem
10
- include EacLauncher::Stereotype
11
-
12
- class << self
13
- def match?(path)
14
- Dir.glob(File.join(path.real, '*.gemspec')).any?
15
- end
16
-
17
- def color
18
- :red
19
- end
20
-
21
- def load_gemspec(gemspec_file)
22
- ::EacLauncher::Ruby::Gem::Specification.new(gemspec_file)
23
- end
24
- end
25
- end
26
- end
27
- end
@@ -1,127 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'curb'
4
- require 'json'
5
- require 'eac_ruby_utils/simple_cache'
6
- require 'rubygems'
7
- require 'eac_ruby_utils/console/speaker'
8
- require 'eac_launcher/publish/base'
9
- require 'eac_launcher/publish/check_result'
10
- require 'eac_launcher/ruby/gem'
11
-
12
- module EacLauncher
13
- module Stereotypes
14
- class RubyGem
15
- class Publish < ::EacLauncher::Publish::Base
16
- include ::EacRubyUtils::SimpleCache
17
- include ::EacRubyUtils::Console::Speaker
18
-
19
- protected
20
-
21
- def internal_check
22
- gem_published? ? internal_check_gem_published : internal_check_gem_unpublished
23
- end
24
-
25
- private
26
-
27
- def internal_check_gem_published
28
- if version_published?
29
- outdated_version? ? outdated_version_check_result : version_published_check_result
30
- else
31
- version_unpublished_check_result
32
- end
33
- end
34
-
35
- def internal_check_gem_unpublished
36
- if new_gem_allowed?
37
- version_unpublished_check_result
38
- else
39
- new_gem_disallowed_check_result
40
- end
41
- end
42
-
43
- def new_gem_disallowed_check_result
44
- ::EacLauncher::Publish::CheckResult.blocked(
45
- "#{gem_spec.full_name} does not exist in RubyGems"
46
- )
47
- end
48
-
49
- def version_published_check_result
50
- ::EacLauncher::Publish::CheckResult.updated("#{gem_spec.full_name} already pushed")
51
- end
52
-
53
- def outdated_version_check_result
54
- ::EacLauncher::Publish::CheckResult.outdated(
55
- "#{gem_spec.full_name} is outdated (Max: #{gem_version_max})"
56
- )
57
- end
58
-
59
- def version_unpublished_check_result
60
- ::EacLauncher::Publish::CheckResult.pending("#{gem_spec.full_name} not found " \
61
- 'in RubyGems')
62
- end
63
-
64
- def source_uncached
65
- instance.warped
66
- end
67
-
68
- def gem_spec_uncached
69
- ::EacLauncher::Stereotypes::RubyGem.load_gemspec(gemspec)
70
- end
71
-
72
- def gem_build_uncached
73
- ::EacLauncher::Ruby::Gem::Build.new(source)
74
- end
75
-
76
- def publish
77
- gem_build.build
78
- push_gem
79
- ensure
80
- gem_build.close
81
- end
82
-
83
- def new_gem_allowed?
84
- ::EacLauncher::Context.current.publish_options[:new]
85
- end
86
-
87
- def gem_published?
88
- gem_versions.any?
89
- end
90
-
91
- def version_published?
92
- gem_versions.any? { |v| v['number'] == gem_spec.version }
93
- end
94
-
95
- def outdated_version?
96
- gem_version_max.present? && ::Gem::Version.new(gem_spec.version) < gem_version_max
97
- end
98
-
99
- def gem_versions_uncached
100
- http = Curl.get("https://rubygems.org/api/v1/versions/#{gem_spec.name}.json")
101
- return JSON.parse!(http.body_str) if /\A2/ =~ http.status
102
- return [] if /\A4/ =~ http.status
103
-
104
- raise "#{http} code error: #{http.status}"
105
- end
106
-
107
- def gem_version_max_uncached
108
- gem_versions.map { |v| ::Gem::Version.new(v['number']) }.max
109
- end
110
-
111
- def push_gem
112
- info("Pushing gem #{gem_spec}...")
113
- command = ['gem', 'push', gem_build.output_file]
114
- unless ::EacLauncher::Context.current.publish_options[:confirm]
115
- command = %w[echo] + command + %w[(Dry-run)]
116
- end
117
- EacRubyUtils::Envs.local.command(command).system
118
- info('Pushed!')
119
- end
120
-
121
- def gemspec_uncached
122
- source.find_file_with_extension('.gemspec')
123
- end
124
- end
125
- end
126
- end
127
- end