avm-tools 0.44.2 → 0.49.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/git/issue/complete.rb +1 -1
  3. data/lib/avm/git/issue/complete/_test.rb +43 -0
  4. data/lib/avm/git/issue/complete/_validations.rb +11 -15
  5. data/lib/avm/git/issue/complete/validation.rb +31 -0
  6. data/lib/avm/git/revision_test.rb +2 -2
  7. data/lib/avm/instances/configuration.rb +12 -0
  8. data/lib/avm/instances/configuration/_rubocop.rb +24 -0
  9. data/lib/avm/instances/configuration/_tests.rb +27 -0
  10. data/lib/avm/rails.rb +9 -0
  11. data/lib/avm/rails/runners.rb +11 -0
  12. data/lib/avm/rails/runners/bundle.rb +35 -0
  13. data/lib/avm/ruby.rb +0 -20
  14. data/lib/avm/ruby/rubocop/_configured.rb +4 -16
  15. data/lib/avm/stereotypes/eac_redmine_base0/deploy.rb +2 -2
  16. data/lib/avm/stereotypes/eac_webapp_base0/instance.rb +3 -3
  17. data/lib/avm/tools/runner/eac_rails_base0/bundle.rb +14 -0
  18. data/lib/avm/tools/runner/eac_redmine_base0/bundle.rb +2 -24
  19. data/lib/avm/tools/runner/eac_redmine_base0/runner.rb +43 -0
  20. data/lib/avm/tools/runner/files/format.rb +1 -1
  21. data/lib/avm/tools/runner/git.rb +1 -1
  22. data/lib/avm/tools/runner/launcher.rb +12 -0
  23. data/lib/avm/tools/version.rb +1 -1
  24. data/lib/eac_launcher.rb +17 -0
  25. data/lib/eac_launcher/context.rb +81 -0
  26. data/lib/eac_launcher/context/instance_discovery.rb +54 -0
  27. data/lib/eac_launcher/context/instance_manager.rb +94 -0
  28. data/lib/eac_launcher/context/settings.rb +51 -0
  29. data/lib/eac_launcher/git.rb +7 -0
  30. data/lib/eac_launcher/git/base.rb +100 -0
  31. data/lib/eac_launcher/git/base/class_methods.rb +26 -0
  32. data/lib/eac_launcher/git/base/dirty_files.rb +30 -0
  33. data/lib/eac_launcher/git/base/remotes.rb +38 -0
  34. data/lib/eac_launcher/git/base/subrepo.rb +42 -0
  35. data/lib/eac_launcher/git/base/underlying.rb +59 -0
  36. data/lib/eac_launcher/git/error.rb +11 -0
  37. data/lib/eac_launcher/git/mirror_update.rb +36 -0
  38. data/lib/eac_launcher/git/publish_base.rb +118 -0
  39. data/lib/eac_launcher/git/remote.rb +53 -0
  40. data/lib/eac_launcher/git/sub_warp_base.rb +30 -0
  41. data/lib/eac_launcher/git/warp_base.rb +54 -0
  42. data/lib/eac_launcher/instances.rb +6 -0
  43. data/lib/eac_launcher/instances/base.rb +91 -0
  44. data/lib/eac_launcher/instances/base/cache.rb +41 -0
  45. data/lib/eac_launcher/instances/error.rb +8 -0
  46. data/lib/eac_launcher/instances/runner_helper.rb +42 -0
  47. data/lib/eac_launcher/instances/settings.rb +23 -0
  48. data/lib/eac_launcher/paths.rb +4 -0
  49. data/lib/eac_launcher/paths/logical.rb +80 -0
  50. data/lib/eac_launcher/paths/real.rb +42 -0
  51. data/lib/eac_launcher/project.rb +16 -0
  52. data/lib/eac_launcher/publish.rb +4 -0
  53. data/lib/eac_launcher/publish/base.rb +45 -0
  54. data/lib/eac_launcher/publish/check_result.rb +65 -0
  55. data/lib/eac_launcher/ruby.rb +3 -0
  56. data/lib/eac_launcher/ruby/gem.rb +4 -0
  57. data/lib/eac_launcher/ruby/gem/build.rb +123 -0
  58. data/lib/eac_launcher/ruby/gem/specification.rb +61 -0
  59. data/lib/eac_launcher/runner.rb +21 -0
  60. data/lib/eac_launcher/runner/instances.rb +41 -0
  61. data/lib/eac_launcher/runner/projects.rb +46 -0
  62. data/lib/eac_launcher/runner/publish.rb +59 -0
  63. data/lib/eac_launcher/stereotype.rb +52 -0
  64. data/lib/eac_launcher/stereotypes.rb +14 -0
  65. data/lib/eac_launcher/stereotypes/git.rb +21 -0
  66. data/lib/eac_launcher/stereotypes/git/publish.rb +13 -0
  67. data/lib/eac_launcher/stereotypes/git/warp.rb +25 -0
  68. data/lib/eac_launcher/stereotypes/git_subrepo.rb +30 -0
  69. data/lib/eac_launcher/stereotypes/git_subrepo/publish.rb +12 -0
  70. data/lib/eac_launcher/stereotypes/git_subrepo/warp.rb +85 -0
  71. data/lib/eac_launcher/stereotypes/git_subtree.rb +47 -0
  72. data/lib/eac_launcher/stereotypes/git_subtree/publish.rb +10 -0
  73. data/lib/eac_launcher/stereotypes/git_subtree/warp.rb +27 -0
  74. data/lib/eac_launcher/stereotypes/rails.rb +21 -0
  75. data/lib/eac_launcher/stereotypes/redmine_plugin.rb +21 -0
  76. data/lib/eac_launcher/stereotypes/ruby_gem.rb +27 -0
  77. data/lib/eac_launcher/stereotypes/ruby_gem/publish.rb +127 -0
  78. data/lib/eac_launcher/vendor.rb +3 -0
  79. data/lib/eac_launcher/vendor/github.rb +18 -0
  80. data/lib/eac_launcher/version.rb +5 -0
  81. metadata +126 -46
  82. data/lib/avm/patches/eac_launcher_git_base.rb +0 -77
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_launcher/vendor/github'
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EacLauncher
4
+ module Vendor
5
+ module Github
6
+ class << self
7
+ def to_ssh_url(url)
8
+ return nil if url.blank?
9
+
10
+ url_no_dot_git = url.gsub(/\.git\z/, '')
11
+
12
+ m = %r{\Ahttps://github.com/([^/]+)/([^/]+)\z}.match(url_no_dot_git.to_s)
13
+ m ? "git@github.com:#{m[1]}/#{m[2]}.git" : url
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EacLauncher
4
+ VERSION = '0.8.0'
5
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.44.2
4
+ version: 0.49.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-30 00:00:00.000000000 Z
11
+ date: 2020-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -59,27 +59,41 @@ dependencies:
59
59
  - !ruby/object:Gem::Version
60
60
  version: 0.0.1
61
61
  - !ruby/object:Gem::Dependency
62
- name: eac_launcher
62
+ name: curb
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '0.6'
67
+ version: 0.9.10
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: 0.9.10
75
+ - !ruby/object:Gem::Dependency
76
+ name: eac_ruby_gem_support
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '0.1'
68
82
  - - ">="
69
83
  - !ruby/object:Gem::Version
70
- version: 0.6.1
71
- type: :runtime
84
+ version: 0.1.1
85
+ type: :development
72
86
  prerelease: false
73
87
  version_requirements: !ruby/object:Gem::Requirement
74
88
  requirements:
75
89
  - - "~>"
76
90
  - !ruby/object:Gem::Version
77
- version: '0.6'
91
+ version: '0.1'
78
92
  - - ">="
79
93
  - !ruby/object:Gem::Version
80
- version: 0.6.1
94
+ version: 0.1.1
81
95
  - !ruby/object:Gem::Dependency
82
- name: eac_ruby_gems_utils
96
+ name: eac_cli
83
97
  requirement: !ruby/object:Gem::Requirement
84
98
  requirements:
85
99
  - - "~>"
@@ -92,20 +106,34 @@ dependencies:
92
106
  - - "~>"
93
107
  - !ruby/object:Gem::Version
94
108
  version: '0.3'
109
+ - !ruby/object:Gem::Dependency
110
+ name: eac_ruby_gems_utils
111
+ requirement: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - "~>"
114
+ - !ruby/object:Gem::Version
115
+ version: '0.4'
116
+ type: :runtime
117
+ prerelease: false
118
+ version_requirements: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - "~>"
121
+ - !ruby/object:Gem::Version
122
+ version: '0.4'
95
123
  - !ruby/object:Gem::Dependency
96
124
  name: eac_ruby_utils
97
125
  requirement: !ruby/object:Gem::Requirement
98
126
  requirements:
99
127
  - - "~>"
100
128
  - !ruby/object:Gem::Version
101
- version: '0.30'
129
+ version: '0.35'
102
130
  type: :runtime
103
131
  prerelease: false
104
132
  version_requirements: !ruby/object:Gem::Requirement
105
133
  requirements:
106
134
  - - "~>"
107
135
  - !ruby/object:Gem::Version
108
- version: '0.30'
136
+ version: '0.35'
109
137
  - !ruby/object:Gem::Dependency
110
138
  name: filesize
111
139
  requirement: !ruby/object:Gem::Requirement
@@ -120,6 +148,20 @@ dependencies:
120
148
  - - ">="
121
149
  - !ruby/object:Gem::Version
122
150
  version: '0'
151
+ - !ruby/object:Gem::Dependency
152
+ name: git
153
+ requirement: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - "~>"
156
+ - !ruby/object:Gem::Version
157
+ version: '1.7'
158
+ type: :runtime
159
+ prerelease: false
160
+ version_requirements: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - "~>"
163
+ - !ruby/object:Gem::Version
164
+ version: '1.7'
123
165
  - !ruby/object:Gem::Dependency
124
166
  name: htmlbeautifier
125
167
  requirement: !ruby/object:Gem::Requirement
@@ -155,53 +197,25 @@ dependencies:
155
197
  - !ruby/object:Gem::Version
156
198
  version: '0'
157
199
  - !ruby/object:Gem::Dependency
158
- name: rspec
159
- requirement: !ruby/object:Gem::Requirement
160
- requirements:
161
- - - '='
162
- - !ruby/object:Gem::Version
163
- version: '3.8'
164
- type: :development
165
- prerelease: false
166
- version_requirements: !ruby/object:Gem::Requirement
167
- requirements:
168
- - - '='
169
- - !ruby/object:Gem::Version
170
- version: '3.8'
171
- - !ruby/object:Gem::Dependency
172
- name: rubocop
173
- requirement: !ruby/object:Gem::Requirement
174
- requirements:
175
- - - '='
176
- - !ruby/object:Gem::Version
177
- version: 0.80.1
178
- type: :development
179
- prerelease: false
180
- version_requirements: !ruby/object:Gem::Requirement
181
- requirements:
182
- - - '='
183
- - !ruby/object:Gem::Version
184
- version: 0.80.1
185
- - !ruby/object:Gem::Dependency
186
- name: rubocop-rspec
200
+ name: ruby-progressbar
187
201
  requirement: !ruby/object:Gem::Requirement
188
202
  requirements:
189
203
  - - "~>"
190
204
  - !ruby/object:Gem::Version
191
- version: '1.34'
205
+ version: '1.10'
192
206
  - - ">="
193
207
  - !ruby/object:Gem::Version
194
- version: 1.34.1
195
- type: :development
208
+ version: 1.10.1
209
+ type: :runtime
196
210
  prerelease: false
197
211
  version_requirements: !ruby/object:Gem::Requirement
198
212
  requirements:
199
213
  - - "~>"
200
214
  - !ruby/object:Gem::Version
201
- version: '1.34'
215
+ version: '1.10'
202
216
  - - ">="
203
217
  - !ruby/object:Gem::Version
204
- version: 1.34.1
218
+ version: 1.10.1
205
219
  description:
206
220
  email:
207
221
  executables:
@@ -256,9 +270,11 @@ files:
256
270
  - lib/avm/git/issue/complete/_local_tag.rb
257
271
  - lib/avm/git/issue/complete/_push.rb
258
272
  - lib/avm/git/issue/complete/_remote.rb
273
+ - lib/avm/git/issue/complete/_test.rb
259
274
  - lib/avm/git/issue/complete/_tracker.rb
260
275
  - lib/avm/git/issue/complete/_validations.rb
261
276
  - lib/avm/git/issue/complete/_working_tree.rb
277
+ - lib/avm/git/issue/complete/validation.rb
262
278
  - lib/avm/git/revision_test.rb
263
279
  - lib/avm/git/spec_helper.rb
264
280
  - lib/avm/instances.rb
@@ -276,13 +292,17 @@ files:
276
292
  - lib/avm/instances/base/auto_values/web.rb
277
293
  - lib/avm/instances/base/dockerizable.rb
278
294
  - lib/avm/instances/configuration.rb
295
+ - lib/avm/instances/configuration/_rubocop.rb
296
+ - lib/avm/instances/configuration/_tests.rb
279
297
  - lib/avm/instances/entries.rb
280
298
  - lib/avm/instances/entries/entry_reader.rb
281
299
  - lib/avm/instances/entry_keys.rb
282
300
  - lib/avm/patches.rb
283
- - lib/avm/patches/eac_launcher_git_base.rb
284
301
  - lib/avm/patches/object/template.rb
285
302
  - lib/avm/path_string.rb
303
+ - lib/avm/rails.rb
304
+ - lib/avm/rails/runners.rb
305
+ - lib/avm/rails/runners/bundle.rb
286
306
  - lib/avm/result.rb
287
307
  - lib/avm/ruby.rb
288
308
  - lib/avm/ruby/rubocop.rb
@@ -329,6 +349,7 @@ files:
329
349
  - lib/avm/tools/runner.rb
330
350
  - lib/avm/tools/runner/eac_rails_base0.rb
331
351
  - lib/avm/tools/runner/eac_rails_base0/apache_host.rb
352
+ - lib/avm/tools/runner/eac_rails_base0/bundle.rb
332
353
  - lib/avm/tools/runner/eac_rails_base0/data.rb
333
354
  - lib/avm/tools/runner/eac_rails_base0/deploy.rb
334
355
  - lib/avm/tools/runner/eac_redmine_base0.rb
@@ -337,6 +358,7 @@ files:
337
358
  - lib/avm/tools/runner/eac_redmine_base0/data/dump.rb
338
359
  - lib/avm/tools/runner/eac_redmine_base0/deploy.rb
339
360
  - lib/avm/tools/runner/eac_redmine_base0/docker.rb
361
+ - lib/avm/tools/runner/eac_redmine_base0/runner.rb
340
362
  - lib/avm/tools/runner/eac_wordpress_base0.rb
341
363
  - lib/avm/tools/runner/eac_wordpress_base0/apache_host.rb
342
364
  - lib/avm/tools/runner/eac_wordpress_base0/data.rb
@@ -351,11 +373,69 @@ files:
351
373
  - lib/avm/tools/runner/git/dirty_files.rb
352
374
  - lib/avm/tools/runner/git/issue.rb
353
375
  - lib/avm/tools/runner/git/revisions_test.rb
376
+ - lib/avm/tools/runner/launcher.rb
354
377
  - lib/avm/tools/runner/ruby.rb
355
378
  - lib/avm/tools/runner/ruby/rubocop.rb
356
379
  - lib/avm/tools/runner/self.rb
357
380
  - lib/avm/tools/runner/self/docker.rb
358
381
  - lib/avm/tools/version.rb
382
+ - lib/eac_launcher.rb
383
+ - lib/eac_launcher/context.rb
384
+ - lib/eac_launcher/context/instance_discovery.rb
385
+ - lib/eac_launcher/context/instance_manager.rb
386
+ - lib/eac_launcher/context/settings.rb
387
+ - lib/eac_launcher/git.rb
388
+ - lib/eac_launcher/git/base.rb
389
+ - lib/eac_launcher/git/base/class_methods.rb
390
+ - lib/eac_launcher/git/base/dirty_files.rb
391
+ - lib/eac_launcher/git/base/remotes.rb
392
+ - lib/eac_launcher/git/base/subrepo.rb
393
+ - lib/eac_launcher/git/base/underlying.rb
394
+ - lib/eac_launcher/git/error.rb
395
+ - lib/eac_launcher/git/mirror_update.rb
396
+ - lib/eac_launcher/git/publish_base.rb
397
+ - lib/eac_launcher/git/remote.rb
398
+ - lib/eac_launcher/git/sub_warp_base.rb
399
+ - lib/eac_launcher/git/warp_base.rb
400
+ - lib/eac_launcher/instances.rb
401
+ - lib/eac_launcher/instances/base.rb
402
+ - lib/eac_launcher/instances/base/cache.rb
403
+ - lib/eac_launcher/instances/error.rb
404
+ - lib/eac_launcher/instances/runner_helper.rb
405
+ - lib/eac_launcher/instances/settings.rb
406
+ - lib/eac_launcher/paths.rb
407
+ - lib/eac_launcher/paths/logical.rb
408
+ - lib/eac_launcher/paths/real.rb
409
+ - lib/eac_launcher/project.rb
410
+ - lib/eac_launcher/publish.rb
411
+ - lib/eac_launcher/publish/base.rb
412
+ - lib/eac_launcher/publish/check_result.rb
413
+ - lib/eac_launcher/ruby.rb
414
+ - lib/eac_launcher/ruby/gem.rb
415
+ - lib/eac_launcher/ruby/gem/build.rb
416
+ - lib/eac_launcher/ruby/gem/specification.rb
417
+ - lib/eac_launcher/runner.rb
418
+ - lib/eac_launcher/runner/instances.rb
419
+ - lib/eac_launcher/runner/projects.rb
420
+ - lib/eac_launcher/runner/publish.rb
421
+ - lib/eac_launcher/stereotype.rb
422
+ - lib/eac_launcher/stereotypes.rb
423
+ - lib/eac_launcher/stereotypes/git.rb
424
+ - lib/eac_launcher/stereotypes/git/publish.rb
425
+ - lib/eac_launcher/stereotypes/git/warp.rb
426
+ - lib/eac_launcher/stereotypes/git_subrepo.rb
427
+ - lib/eac_launcher/stereotypes/git_subrepo/publish.rb
428
+ - lib/eac_launcher/stereotypes/git_subrepo/warp.rb
429
+ - lib/eac_launcher/stereotypes/git_subtree.rb
430
+ - lib/eac_launcher/stereotypes/git_subtree/publish.rb
431
+ - lib/eac_launcher/stereotypes/git_subtree/warp.rb
432
+ - lib/eac_launcher/stereotypes/rails.rb
433
+ - lib/eac_launcher/stereotypes/redmine_plugin.rb
434
+ - lib/eac_launcher/stereotypes/ruby_gem.rb
435
+ - lib/eac_launcher/stereotypes/ruby_gem/publish.rb
436
+ - lib/eac_launcher/vendor.rb
437
+ - lib/eac_launcher/vendor/github.rb
438
+ - lib/eac_launcher/version.rb
359
439
  - template/avm/self/docker_image/Dockerfile
360
440
  - template/avm/self/docker_image/entrypoint.sh
361
441
  - template/avm/stereotypes/eac_rails_base0/deploy/config/database.yml.template
@@ -1,77 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_launcher/git/base'
4
- require 'eac_launcher/git/error'
5
- require 'eac_ruby_utils/patch'
6
- require 'eac_ruby_utils/require_sub'
7
- ::EacRubyUtils.require_sub(__FILE__)
8
-
9
- module Avm
10
- module Patches
11
- module EacLauncherGitBase
12
- extend ::ActiveSupport::Concern
13
-
14
- included do
15
- extend ClassMethods
16
- include InstanceMethods
17
- end
18
-
19
- module ClassMethods
20
- # @return [EacLauncher::Git::Base]
21
- def by_root(search_base_path)
22
- new(find_root(search_base_path).to_path)
23
- end
24
-
25
- # Searches the root path for the Git repository which includes +search_base_path+.
26
- # @return [Pathname]
27
- def find_root(search_base_path)
28
- path = search_base_path.to_pathname.expand_path
29
- loop do
30
- return path if path.join('.git').exist?
31
- raise "\".git\" not found for \"#{search_base_path}\"" if path.parent.root?
32
-
33
- path = path.parent
34
- end
35
- end
36
- end
37
-
38
- module InstanceMethods
39
- def execute(*args)
40
- args, options = build_args(args)
41
- ::EacRubyUtils::Envs.local.command(*args).execute(options)
42
- end
43
-
44
- def command(*args)
45
- args, _options = build_args(args)
46
- ::EacRubyUtils::Envs.local.command(*args)
47
- end
48
-
49
- def dirty?
50
- dirty_files.any?
51
- end
52
-
53
- def dirty_files
54
- execute!('status', '--porcelain', '--untracked-files').each_line.map do |line|
55
- parse_status_line(line.gsub(/\n\z/, ''))
56
- end
57
- end
58
-
59
- # @return [Pathname]
60
- def root_path
61
- @root_path ||= self.class.find_root(to_s)
62
- end
63
-
64
- private
65
-
66
- def parse_status_line(line)
67
- m = /\A(.)(.)\s(.+)\z/.match(line)
68
- ::Kernel.raise "Status pattern does not match \"#{line}\"" unless m
69
- ::OpenStruct.new(index: m[1], worktree: m[2], path: m[3],
70
- absolute_path: ::File.expand_path(m[3], self))
71
- end
72
- end
73
- end
74
- end
75
- end
76
-
77
- ::EacRubyUtils.patch(::EacLauncher::Git::Base, ::Avm::Patches::EacLauncherGitBase)