avm-tools 0.103.0 → 0.106.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/data/package/dump.rb +1 -1
- data/lib/avm/instances/base/dockerizable.rb +2 -1
- data/lib/avm/launcher/context/instance_collector.rb +46 -0
- data/lib/avm/launcher/instances/runner_helper.rb +22 -16
- data/lib/avm/launcher/paths/logical.rb +5 -0
- data/lib/avm/{core_ext.rb → tools/core_ext.rb} +0 -0
- data/lib/avm/tools/runner/app_src/eac_asciidoctor_base0/build.rb +1 -1
- data/lib/avm/tools/runner/app_src/info.rb +1 -1
- data/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb +62 -0
- data/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock.rb +11 -41
- data/lib/avm/tools/runner/app_src/test.rb +1 -1
- data/lib/avm/tools/runner/app_src/update.rb +1 -1
- data/lib/avm/tools/runner/config/load_path.rb +1 -1
- data/lib/avm/tools/runner/config.rb +1 -1
- data/lib/avm/tools/runner/git/dirty_files.rb +1 -1
- data/lib/avm/tools/runner/git/issue/complete.rb +1 -1
- data/lib/avm/tools/runner/git/issue/deliver.rb +1 -1
- data/lib/avm/tools/runner/git/issue.rb +1 -1
- data/lib/avm/tools/runner/git/revisions_test.rb +1 -1
- data/lib/avm/tools/runner/git/subrepo/check.rb +1 -1
- data/lib/avm/tools/runner/git/subrepo/clone.rb +1 -1
- data/lib/avm/tools/runner/git/subrepo/fix.rb +1 -1
- data/lib/avm/tools/runner/git/subrepo.rb +1 -1
- data/lib/avm/tools/runner/git.rb +1 -1
- data/lib/avm/tools/runner/launcher/instances.rb +7 -5
- data/lib/avm/tools/runner/launcher/projects.rb +2 -4
- data/lib/avm/tools/runner/launcher/publish.rb +2 -6
- data/lib/avm/tools/runner/launcher.rb +1 -1
- data/lib/avm/tools/runner/ruby/rubocop.rb +1 -1
- data/lib/avm/tools/runner/self.rb +1 -1
- data/lib/avm/tools/version.rb +1 -1
- data/vendor/avm/avm.gemspec +4 -1
- data/vendor/avm/lib/avm/docker/runner.rb +4 -8
- data/{lib → vendor/avm/lib}/avm/executables.rb +1 -1
- data/{lib → vendor/avm/lib}/avm/files/appendable/file_content.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/files/appendable/plain_directory.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/files/appendable/resource_base.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/files/appendable/tar_output_command.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/files/appendable/templatized_directory.rb +1 -0
- data/{lib → vendor/avm/lib}/avm/files/appendable.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/files/appender.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/files/deploy.rb +0 -1
- data/{lib → vendor/avm/lib}/avm/files/formatter/formats/base.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/files/formatter/formats/generic_plain.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/files/formatter/formats/html.rb +0 -0
- data/vendor/avm/lib/avm/files/formatter/formats/javascript.rb +23 -0
- data/{lib → vendor/avm/lib}/avm/files/formatter/formats/json.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/files/formatter/formats/php.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/files/formatter/formats/python.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/files/formatter/formats/ruby.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/files/formatter/formats/xml.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/files/formatter/formats.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/files/formatter/utf8_assert.rb +2 -0
- data/{lib → vendor/avm/lib}/avm/files/formatter.rb +1 -1
- data/{lib → vendor/avm/lib}/avm/files/info.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/files/rotate.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/files.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/auto_commit/commit_info.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules/base.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules/last.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules/manual.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules/new.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules/nth.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules/unique.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/auto_commit/rules.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/auto_commit_path/ruby.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/auto_commit_path.rb +1 -1
- data/{lib → vendor/avm/lib}/avm/git/commit/class_methods.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/commit/deploy.rb +0 -1
- data/{lib → vendor/avm/lib}/avm/git/commit/deploy_methods.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/commit/diff_tree_line.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/commit/file.rb +2 -2
- data/{lib → vendor/avm/lib}/avm/git/commit.rb +3 -2
- data/{lib → vendor/avm/lib}/avm/git/file_auto_fixup.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/issue/complete/commits.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/issue/complete/git_subrepos.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/issue/complete/local_branch.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/issue/complete/local_tag.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/issue/complete/push.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/issue/complete/remote.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/issue/complete/test.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/issue/complete/tracker.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/issue/complete/validation.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/issue/complete/validations.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/issue/complete/working_tree.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/issue/complete.rb +1 -1
- data/{lib → vendor/avm/lib}/avm/git/issue/deliver.rb +1 -1
- data/{lib → vendor/avm/lib}/avm/git/issue.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/organize/reference_update.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/organize/repository.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/organize.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/revision_test.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/subrepo_check/parent.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/subrepo_check/remote.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/git/subrepo_check/show_result.rb +0 -1
- data/{lib → vendor/avm/lib}/avm/git/subrepo_check.rb +0 -1
- data/{lib → vendor/avm/lib}/avm/git/subrepo_checks.rb +1 -1
- data/{lib → vendor/avm/lib}/avm/git.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/instances/docker_image.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/result.rb +0 -0
- data/vendor/avm/lib/avm/version.rb +1 -1
- data/vendor/avm/spec/lib/avm/git/auto_commit_path_spec.rb +21 -0
- data/vendor/avm/spec/lib/avm/git/commit/deploy_spec.rb +93 -0
- data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec.rb +13 -0
- data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/add.source.out +1 -0
- data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/add.target.yaml +7 -0
- data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/modify.source.out +1 -0
- data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/modify.target.yaml +7 -0
- data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/remove.source.out +1 -0
- data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/remove.target.yaml +7 -0
- data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename.source.out +2 -0
- data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename.target.yaml +13 -0
- data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename_modify.source.out +2 -0
- data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename_modify.target.yaml +13 -0
- data/vendor/avm/spec/lib/avm/git/commit_spec.rb +56 -0
- data/vendor/avm/spec/rubocop_spec.rb +1 -1
- data/vendor/avm/spec/spec_helper.rb +2 -100
- data/vendor/avm-apps/lib/avm/apps/version.rb +1 -1
- data/vendor/avm-apps/spec/rubocop_spec.rb +1 -1
- data/vendor/avm-apps/spec/spec_helper.rb +2 -101
- data/vendor/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec +1 -0
- data/{lib → vendor/avm-eac_asciidoctor_base0/lib}/avm/eac_asciidoctor_base0/apache_host.rb +0 -0
- data/{lib → vendor/avm-eac_asciidoctor_base0/lib}/avm/eac_asciidoctor_base0/apache_path.rb +0 -0
- data/{lib → vendor/avm-eac_asciidoctor_base0/lib}/avm/eac_asciidoctor_base0/deploy.rb +0 -0
- data/{lib → vendor/avm-eac_asciidoctor_base0/lib}/avm/eac_asciidoctor_base0/instance.rb +0 -0
- data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
- data/vendor/avm-eac_asciidoctor_base0/spec/rubocop_spec.rb +1 -1
- data/vendor/avm-eac_asciidoctor_base0/spec/spec_helper.rb +2 -100
- data/vendor/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/logs.rb +1 -1
- data/vendor/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
- data/vendor/avm-eac_rails_base1/spec/rubocop_spec.rb +1 -1
- data/vendor/avm-eac_rails_base1/spec/spec_helper.rb +2 -100
- data/vendor/avm-eac_redmine_base0/Gemfile +5 -0
- data/vendor/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +19 -0
- data/{lib → vendor/avm-eac_redmine_base0/lib}/avm/eac_redmine_base0/apache_host.rb +0 -0
- data/{lib → vendor/avm-eac_redmine_base0/lib}/avm/eac_redmine_base0/core_update.rb +0 -0
- data/{lib → vendor/avm-eac_redmine_base0/lib}/avm/eac_redmine_base0/data_unit.rb +0 -0
- data/{lib → vendor/avm-eac_redmine_base0/lib}/avm/eac_redmine_base0/deploy.rb +0 -0
- data/{lib → vendor/avm-eac_redmine_base0/lib}/avm/eac_redmine_base0/instance.rb +2 -2
- data/vendor/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb +55 -0
- data/vendor/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/patches/object/template.rb +7 -0
- data/vendor/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +7 -0
- data/{lib/avm/eac_asciidoctor_base0.rb → vendor/avm-eac_redmine_base0/lib/avm/eac_redmine_base0.rb} +1 -1
- data/vendor/avm-eac_redmine_base0/spec/rubocop_spec.rb +3 -0
- data/vendor/avm-eac_redmine_base0/spec/spec_helper.rb +4 -0
- data/{template → vendor/avm-eac_redmine_base0/template}/avm/eac_redmine_base0/deploy/config/install.sh.template +1 -0
- data/{template → vendor/avm-eac_redmine_base0/template}/avm/eac_redmine_base0/deploy/config/secrets.yml +0 -0
- data/{template/avm/eac_redmine_base0 → vendor/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances}/docker_image/Dockerfile.template +1 -1
- data/{template/avm/eac_redmine_base0 → vendor/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances}/docker_image/apache_http_virtualhost.conf.template +0 -0
- data/{template/avm/eac_redmine_base0 → vendor/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances}/docker_image/apache_https_virtualhost.conf.template +0 -0
- data/vendor/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/install_settings.sh.template +24 -0
- data/{template/avm/eac_redmine_base0 → vendor/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances}/docker_image/start.sh.template +0 -0
- data/vendor/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
- data/vendor/avm-eac_webapp_base0/spec/rubocop_spec.rb +1 -1
- data/vendor/avm-eac_webapp_base0/spec/spec_helper.rb +2 -100
- data/vendor/eac_cli/eac_cli.gemspec +3 -3
- data/vendor/eac_cli/lib/eac_cli/config/entry.rb +0 -2
- data/vendor/eac_cli/lib/eac_cli/definition/argument_option.rb +1 -1
- data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +9 -1
- data/vendor/eac_cli/lib/eac_cli/definition/boolean_option.rb +6 -0
- data/vendor/eac_cli/lib/eac_cli/runner_with/help/builder.rb +3 -3
- data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
- data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +6 -5
- data/vendor/eac_cli/spec/rubocop_spec.rb +1 -1
- data/vendor/eac_cli/spec/spec_helper.rb +2 -101
- data/vendor/eac_config/eac_config.gemspec +2 -2
- data/vendor/eac_config/lib/eac_config/version.rb +1 -1
- data/vendor/eac_config/spec/rubocop_spec.rb +1 -1
- data/vendor/eac_config/spec/spec_helper.rb +2 -15
- data/vendor/eac_docker/eac_docker.gemspec +2 -2
- data/vendor/eac_docker/lib/eac_docker/container.rb +7 -3
- data/vendor/eac_docker/lib/eac_docker/debug.rb +15 -0
- data/vendor/eac_docker/lib/eac_docker/images/coded.rb +4 -0
- data/vendor/eac_docker/lib/eac_docker/images/templatized.rb +16 -2
- data/vendor/eac_docker/lib/eac_docker/rspec/setup.rb +17 -0
- data/vendor/eac_docker/lib/eac_docker/rspec.rb +2 -10
- data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
- data/vendor/eac_docker/spec/rubocop_spec.rb +1 -1
- data/vendor/eac_docker/spec/spec_helper.rb +2 -104
- data/vendor/eac_git/eac_git.gemspec +3 -3
- data/vendor/eac_git/lib/eac_git/rspec/setup.rb +23 -0
- data/vendor/eac_git/lib/eac_git/rspec.rb +1 -14
- data/vendor/eac_git/lib/eac_git/version.rb +1 -1
- data/vendor/eac_git/spec/rubocop_spec.rb +1 -1
- data/vendor/eac_git/spec/spec_helper.rb +2 -104
- data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +4 -4
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
- data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +1 -1
- data/vendor/eac_ruby_base0/spec/spec_helper.rb +2 -101
- data/vendor/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +2 -2
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
- data/vendor/eac_ruby_gems_utils/spec/code/rubocop_check_spec.rb +1 -1
- data/vendor/eac_ruby_gems_utils/spec/spec_helper.rb +2 -101
- data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/boolean.rb +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/compact.rb +22 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/executable.rb +15 -3
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs_cache.rb +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +75 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +35 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/compact.rb +20 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/delimited.rb +16 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/recursive_builder.rb +51 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/default_setup.rb +20 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup/conditionals.rb +17 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup.rb +12 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup_manager.rb +49 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/string_delimited.rb +70 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/compact_spec.rb +20 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/compact_spec.rb +20 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/string/delimited_spec.rb +34 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/recursive_builder_spec.rb +65 -0
- data/vendor/eac_ruby_utils/spec/rubocop_check_spec.rb +1 -1
- data/vendor/eac_ruby_utils/spec/spec_helper.rb +6 -6
- data/vendor/eac_templates/lib/eac_templates/version.rb +1 -1
- data/vendor/eac_templates/spec/rubocop_spec.rb +1 -1
- data/vendor/eac_templates/spec/spec_helper.rb +2 -100
- metadata +129 -91
- data/lib/avm/eac_redmine_base0/docker_image.rb +0 -52
- data/lib/avm/eac_redmine_base0.rb +0 -9
- data/template/avm/eac_redmine_base0/docker_image/install_settings.sh.template +0 -29
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/conditional.rb +0 -35
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/stubbed_ssh.rb +0 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a71fc17b60e581ba891e58d0b47ad9b4dbae79c2085540bb1816e02011e9af9
|
4
|
+
data.tar.gz: 15387681892ce7192edd15b0e68ee801ed0fca233454b802df21f7d5e0a211a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d61dadda2108d0d2b7a37f9ec55bbcbc73e222c87f463feec8b91d8f486b3869f1652849296a9bcb7c33e58fe65f1a99f5d12fe7e71c2b1fcf58231b2f453124
|
7
|
+
data.tar.gz: 13a712ee6f75e13797fcf5107ad9b0c72f730195d4264e36ea5368635205aa68c55deb88c8055f01381342cefe48bf74d0decba9d6fe5052df6c6571622a1daf
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'eac_docker/executables'
|
3
4
|
require 'eac_ruby_utils/core_ext'
|
4
5
|
require 'avm/docker/container'
|
5
6
|
|
@@ -16,7 +17,7 @@ module Avm
|
|
16
17
|
end
|
17
18
|
|
18
19
|
def docker_container_exist?
|
19
|
-
::
|
20
|
+
::EacDocker::Executables.docker.command.append(
|
20
21
|
['ps', '-qaf', "name=#{docker_container_name}"]
|
21
22
|
).execute!.present?
|
22
23
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Launcher
|
7
|
+
class Context
|
8
|
+
class InstanceCollector
|
9
|
+
common_constructor :context
|
10
|
+
|
11
|
+
def add_all
|
12
|
+
instances_set.merge(context.instances)
|
13
|
+
self
|
14
|
+
end
|
15
|
+
|
16
|
+
def add_path(path)
|
17
|
+
instances_set.merge(instances_on_path(path))
|
18
|
+
self
|
19
|
+
end
|
20
|
+
|
21
|
+
def add_pending
|
22
|
+
instances_set.merge(context.pending_instances)
|
23
|
+
self
|
24
|
+
end
|
25
|
+
|
26
|
+
def instances
|
27
|
+
instances_set.sort
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def instance_match?(instance, instance_name)
|
33
|
+
::File.fnmatch?(instance_name, instance.name)
|
34
|
+
end
|
35
|
+
|
36
|
+
def instances_on_path(path)
|
37
|
+
context.instances.select { |instance| instance_match?(instance, path) }
|
38
|
+
end
|
39
|
+
|
40
|
+
def instances_set
|
41
|
+
@instances_set ||= ::Set.new
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -1,31 +1,33 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/
|
3
|
+
require 'avm/launcher/context'
|
4
|
+
require 'avm/tools/core_ext'
|
5
|
+
require 'avm/launcher/context/instance_collector'
|
4
6
|
|
5
7
|
module Avm
|
6
8
|
module Launcher
|
7
9
|
module Instances
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
10
|
+
module RunnerHelper
|
11
|
+
common_concern do
|
12
|
+
runner_definition do
|
13
|
+
bool_opt '--all', 'Select all instances.'
|
14
|
+
bool_opt '--pending', 'Select pending instances.'
|
15
|
+
bool_opt '--recache', 'Rewrite instances cache.'
|
16
|
+
end
|
12
17
|
|
13
|
-
|
14
|
-
context.instances.select { |instance| instance_match?(instance, instance_name) }
|
18
|
+
set_callback :run, :before, :setup_cache
|
15
19
|
end
|
16
20
|
|
17
|
-
def
|
18
|
-
::
|
21
|
+
def context
|
22
|
+
@context ||= ::Avm::Launcher::Context.current
|
19
23
|
end
|
20
24
|
|
21
25
|
def instances
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
parsed.instance_path.flat_map { |p| find_instances(p) }
|
28
|
-
end
|
26
|
+
collector = ::Avm::Launcher::Context::InstanceCollector.new(context)
|
27
|
+
collector.add_all if parsed.all?
|
28
|
+
collector.add_pending if parsed.pending?
|
29
|
+
parsed.instance_path.flat_map { |p| collector.add_path(p) }
|
30
|
+
collector.instances
|
29
31
|
end
|
30
32
|
|
31
33
|
def instance_stereotypes(instance)
|
@@ -35,6 +37,10 @@ module Avm
|
|
35
37
|
def instance_label(instance)
|
36
38
|
"#{instance.name} [#{instance_stereotypes(instance)}]"
|
37
39
|
end
|
40
|
+
|
41
|
+
def setup_cache
|
42
|
+
::Avm::Launcher::Context.current.recache = parsed.recache?
|
43
|
+
end
|
38
44
|
end
|
39
45
|
end
|
40
46
|
end
|
@@ -7,6 +7,7 @@ module Avm
|
|
7
7
|
module Launcher
|
8
8
|
module Paths
|
9
9
|
class Logical
|
10
|
+
include ::Comparable
|
10
11
|
include ::EacRubyUtils::SimpleCache
|
11
12
|
|
12
13
|
class << self
|
@@ -25,6 +26,10 @@ module Avm
|
|
25
26
|
@logical = logical
|
26
27
|
end
|
27
28
|
|
29
|
+
def <=>(other)
|
30
|
+
[logical, real] <=> [other.logical, other.real]
|
31
|
+
end
|
32
|
+
|
28
33
|
def to_s
|
29
34
|
logical
|
30
35
|
end
|
File without changes
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_base0/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Tools
|
7
|
+
class Runner
|
8
|
+
class AppSrc
|
9
|
+
class Ruby
|
10
|
+
class Bundler
|
11
|
+
class GemfileLock
|
12
|
+
module Git
|
13
|
+
private
|
14
|
+
|
15
|
+
def git_continue
|
16
|
+
return unless check_capability(__method__, :git_repo, :continue)
|
17
|
+
|
18
|
+
infom "Adding \"#{gemfile_lock}\"..."
|
19
|
+
instance.git_repo.command('add', gemfile_lock).execute!
|
20
|
+
if rebase_conflict?
|
21
|
+
git_continue_run('rebase')
|
22
|
+
elsif cherry_conflict?
|
23
|
+
git_continue_run('cherry-pick')
|
24
|
+
else
|
25
|
+
raise 'Unknown how to continue'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def git_continue_run(command)
|
30
|
+
infom "\"#{command}\" --continue..."
|
31
|
+
cmd = instance.git_repo.command(command, '--continue')
|
32
|
+
.envvar('GIT_EDITOR', 'true')
|
33
|
+
return unless !cmd.system && !conflict?
|
34
|
+
|
35
|
+
fatal_error "\"#{cmd}\" failed and there is no conflict"
|
36
|
+
end
|
37
|
+
|
38
|
+
def git_reset_checkout
|
39
|
+
return unless check_capability(__method__, :git_repo, nil)
|
40
|
+
|
41
|
+
git_reset_gemfile_lock
|
42
|
+
git_checkout_gemfile_lock
|
43
|
+
end
|
44
|
+
|
45
|
+
def git_checkout_gemfile_lock
|
46
|
+
infom 'Checkouting...'
|
47
|
+
instance.git_repo.command('checkout', '--', gemfile_lock).system!
|
48
|
+
end
|
49
|
+
|
50
|
+
def git_reset_gemfile_lock
|
51
|
+
infom 'Reseting...'
|
52
|
+
instance.git_repo.command('reset', gemfile_lock).system! if
|
53
|
+
::File.exist?(gemfile_lock)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -9,18 +9,21 @@ module Avm
|
|
9
9
|
class Ruby
|
10
10
|
class Bundler
|
11
11
|
class GemfileLock
|
12
|
+
require_sub __FILE__, include_modules: true
|
12
13
|
runner_with :help do
|
13
14
|
desc 'Manipulage a "Gemfile.lock" file.'
|
14
15
|
bool_opt '-c', '--continue', 'Continue Git rebase/cherry-pick.'
|
15
16
|
bool_opt '-i', '--install', 'Run "bundle install".'
|
16
17
|
bool_opt '-u', '--update', 'Run "bundle update".'
|
17
18
|
bool_opt '-r', '--recursive', 'Run until Git rebase/cherry-pick is finished.'
|
18
|
-
bool_opt '-a', '--all', 'Same as "-
|
19
|
+
bool_opt '-a', '--all', 'Same as "-cirud".'
|
20
|
+
bool_opt '-d', '--delete', 'Delete Gemfile.lock'
|
19
21
|
end
|
20
22
|
|
21
23
|
def run
|
22
24
|
loop do
|
23
25
|
git_reset_checkout
|
26
|
+
delete_gemfile_lock
|
24
27
|
bundle_update
|
25
28
|
bundle_install
|
26
29
|
git_continue
|
@@ -34,17 +37,14 @@ module Avm
|
|
34
37
|
!option_or_all?(:recursive) || !conflict?
|
35
38
|
end
|
36
39
|
|
37
|
-
def
|
38
|
-
|
39
|
-
end
|
40
|
+
def delete_gemfile_lock
|
41
|
+
return unless check_capability(__method__, nil, :delete)
|
40
42
|
|
41
|
-
|
42
|
-
|
43
|
+
::FileUtils.rm_f(gemfile_lock)
|
44
|
+
end
|
43
45
|
|
44
|
-
|
45
|
-
instance.git_repo.
|
46
|
-
infom 'Checkouting...'
|
47
|
-
instance.git_repo.command('checkout', '--', gemfile_lock).system!
|
46
|
+
def rebasing?
|
47
|
+
instance.git_repo.root_path.join('.git', 'rebase-merge').exist?
|
48
48
|
end
|
49
49
|
|
50
50
|
def bundle_install
|
@@ -61,44 +61,14 @@ module Avm
|
|
61
61
|
bundle_run('update')
|
62
62
|
end
|
63
63
|
|
64
|
-
def git_continue
|
65
|
-
return unless check_capability(__method__, :git_repo, :continue)
|
66
|
-
|
67
|
-
infom "Adding \"#{gemfile_lock}\"..."
|
68
|
-
instance.git_repo.command('add', gemfile_lock).execute!
|
69
|
-
if rebase_conflict?
|
70
|
-
git_continue_run('rebase')
|
71
|
-
elsif cherry_conflict?
|
72
|
-
git_continue_run('cherry-pick')
|
73
|
-
else
|
74
|
-
raise 'Unknown how to continue'
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
def git_continue_run(command)
|
79
|
-
infom "\"#{command}\" --continue..."
|
80
|
-
cmd = instance.git_repo.command(command, '--continue').envvar('GIT_EDITOR', 'true')
|
81
|
-
return unless !cmd.system && !conflict?
|
82
|
-
|
83
|
-
fatal_error "\"#{cmd}\" failed and there is no conflict"
|
84
|
-
end
|
85
|
-
|
86
64
|
def gemfile_lock
|
87
65
|
'Gemfile.lock'
|
88
66
|
end
|
89
67
|
|
90
|
-
def git_uncached
|
91
|
-
::EacGit::Local.new(git_path)
|
92
|
-
end
|
93
|
-
|
94
68
|
def bundle_run(*args)
|
95
69
|
instance.ruby_gem.bundle(*args).system!
|
96
70
|
end
|
97
71
|
|
98
|
-
def git_path
|
99
|
-
'.'
|
100
|
-
end
|
101
|
-
|
102
72
|
def conflict?
|
103
73
|
rebase_conflict? || cherry_conflict?
|
104
74
|
end
|
@@ -121,7 +91,7 @@ module Avm
|
|
121
91
|
|
122
92
|
def check_capability(caller, capability, option)
|
123
93
|
return false unless option.blank? || option_or_all?(option)
|
124
|
-
return true if instance.respond_to?(
|
94
|
+
return true if capability.if_present(true) { |v| instance.respond_to?(v) }
|
125
95
|
|
126
96
|
warn "Cannot run #{caller}: instance has no capability \"#{capability}\""
|
127
97
|
false
|
data/lib/avm/tools/runner/git.rb
CHANGED
@@ -6,16 +6,14 @@ module Avm
|
|
6
6
|
module Tools
|
7
7
|
class Runner
|
8
8
|
class Launcher
|
9
|
-
class Instances
|
10
|
-
runner_with :help do
|
9
|
+
class Instances
|
10
|
+
runner_with :help, ::Avm::Launcher::Instances::RunnerHelper do
|
11
11
|
desc 'Mostra informações sobre instâncias.'
|
12
|
-
bool_opt '--
|
13
|
-
bool_opt '--all', 'Get all instances.'
|
12
|
+
bool_opt '-e', '--extra', 'Show instances\' extra data.'
|
14
13
|
pos_arg :instance_path, repeat: true, optional: true
|
15
14
|
end
|
16
15
|
|
17
16
|
def run
|
18
|
-
::Avm::Launcher::Context.current.recache = parsed.recache?
|
19
17
|
instances.each { |i| show_instance(i) }
|
20
18
|
end
|
21
19
|
|
@@ -23,6 +21,10 @@ module Avm
|
|
23
21
|
|
24
22
|
def show_instance(instance)
|
25
23
|
puts instance_label(instance)
|
24
|
+
show_instance_extra(instance) if parsed.extra?
|
25
|
+
end
|
26
|
+
|
27
|
+
def show_instance_extra(instance)
|
26
28
|
infov(' * Parent', (instance.parent ? instance_label(instance.parent) : '-'))
|
27
29
|
infov(' * Git current revision', instance.options.git_current_revision)
|
28
30
|
infov(' * Git publish remote', instance.options.git_publish_remote)
|
@@ -7,15 +7,13 @@ module Avm
|
|
7
7
|
module Tools
|
8
8
|
class Runner
|
9
9
|
class Launcher
|
10
|
-
class Projects
|
11
|
-
runner_with :help do
|
10
|
+
class Projects
|
11
|
+
runner_with :help, ::Avm::Launcher::Instances::RunnerHelper do
|
12
12
|
desc 'Shows available projects.'
|
13
|
-
bool_opt '--recache', 'Rewrite instances cache.'
|
14
13
|
bool_opt '-i', '--instances', 'Show instances.'
|
15
14
|
end
|
16
15
|
|
17
16
|
def run
|
18
|
-
::Avm::Launcher::Context.current.recache = parsed.recache?
|
19
17
|
::Avm::Launcher::Context.current.projects.each do |p|
|
20
18
|
show_project(p)
|
21
19
|
end
|
@@ -6,21 +6,17 @@ module Avm
|
|
6
6
|
module Tools
|
7
7
|
class Runner
|
8
8
|
class Launcher
|
9
|
-
class Publish
|
10
|
-
runner_with :help do
|
9
|
+
class Publish
|
10
|
+
runner_with :help, ::Avm::Launcher::Instances::RunnerHelper do
|
11
11
|
desc 'Publica projetos ou instâncias.'
|
12
|
-
bool_opt '--all', 'Get all instances.'
|
13
12
|
bool_opt '-d', '--dry-run', '"Dry run" publishing.'
|
14
13
|
bool_opt '--new', 'Publish projects not published before.'
|
15
|
-
bool_opt '--pending', 'Publish only pending.'
|
16
|
-
bool_opt '--recache', 'Rewrite instances cache.'
|
17
14
|
bool_opt '--run', 'Confirm publishing.'
|
18
15
|
arg_opt '-s', '--stereotype', 'Publish only for stereotype <stereotype>.'
|
19
16
|
pos_arg :instance_path, repeat: true, optional: true
|
20
17
|
end
|
21
18
|
|
22
19
|
def run
|
23
|
-
::Avm::Launcher::Context.current.recache = parsed.recache?
|
24
20
|
build_publish_options
|
25
21
|
instances.each do |i|
|
26
22
|
next unless i.options.publishable?
|
data/lib/avm/tools/version.rb
CHANGED
data/vendor/avm/avm.gemspec
CHANGED
@@ -12,8 +12,11 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = Dir['{lib}/**/*']
|
14
14
|
|
15
|
-
s.add_dependency 'eac_docker', '~> 0.
|
15
|
+
s.add_dependency 'eac_docker', '~> 0.3'
|
16
|
+
s.add_dependency 'eac_git', '~> 0.6'
|
16
17
|
s.add_dependency 'eac_ruby_utils', '~> 0.68'
|
18
|
+
s.add_dependency 'eac_templates', '~> 0.1', '>= 0.1.1'
|
17
19
|
|
20
|
+
s.add_development_dependency 'aranha-parsers', '~> 0.7', '>= 0.7.2'
|
18
21
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
|
19
22
|
end
|
@@ -6,6 +6,8 @@ require 'eac_ruby_utils/core_ext'
|
|
6
6
|
module Avm
|
7
7
|
module Docker
|
8
8
|
class Runner
|
9
|
+
DOCKER_DEFAULT_REGISTRY_METHOD = :docker_default_registry
|
10
|
+
|
9
11
|
enable_speaker
|
10
12
|
enable_simple_cache
|
11
13
|
|
@@ -92,17 +94,11 @@ module Avm
|
|
92
94
|
end
|
93
95
|
|
94
96
|
def registry_from_instance
|
95
|
-
|
96
|
-
instance.docker_registry_optional.if_present { |v| ::EacDocker::Registry.new(v) }
|
97
|
-
else
|
98
|
-
::EacDocker::Registry.new(instance.docker_registry)
|
99
|
-
end
|
97
|
+
instance.docker_registry_optional.if_present { |v| ::EacDocker::Registry.new(v) }
|
100
98
|
end
|
101
99
|
|
102
100
|
def registry_from_default
|
103
|
-
|
104
|
-
|
105
|
-
nyi 'Was "::Avm::Docker::Registry.default"'
|
101
|
+
if_respond(DOCKER_DEFAULT_REGISTRY_METHOD, nil)
|
106
102
|
end
|
107
103
|
|
108
104
|
def snapshot?
|
@@ -14,7 +14,7 @@ module Avm
|
|
14
14
|
|
15
15
|
private
|
16
16
|
|
17
|
-
%w[
|
17
|
+
%w[file git js-beautify latex php-cs-fixer tidy yapf xdg-open].each do |program|
|
18
18
|
define_method(program.underscore + '_uncached') do
|
19
19
|
env.executable(program, '--version')
|
20
20
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|