avm-tools 0.115.0 → 0.116.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/launcher/instances/settings.rb +7 -3
- data/lib/avm/projects/stereotypes.rb +2 -2
- data/lib/avm/ruby/bundler/incompatible_parser/depends_on.rb +1 -1
- data/lib/avm/ruby/bundler/incompatible_parser/gem_conflict.rb +1 -1
- data/lib/avm/ruby/bundler/incompatible_parser/in_gemfile.rb +1 -1
- data/lib/avm/ruby/bundler/incompatible_parser/version_requirement.rb +1 -1
- data/lib/avm/ruby/bundler/incompatible_parser.rb +1 -1
- data/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb +1 -1
- data/lib/avm/tools/runner/app_src/test.rb +2 -2
- data/lib/avm/tools/runner/git/deploy.rb +5 -5
- data/lib/avm/tools/runner/git/dirty_files.rb +1 -1
- data/lib/avm/tools/runner/git/revisions_test.rb +1 -1
- data/lib/avm/tools/runner/ruby/rubocop.rb +2 -2
- data/lib/avm/tools/version.rb +1 -1
- data/sub/avm/avm.gemspec +2 -2
- data/sub/avm/lib/avm/instances/base/auto_values/mailer.rb +2 -2
- data/sub/avm/lib/avm/instances/entry_keys.rb +2 -0
- data/sub/avm/lib/avm/registry/base.rb +2 -2
- data/sub/avm/lib/avm/rspec/shared_examples/not_in_avm_registry.rb +1 -1
- data/sub/avm/lib/avm/sources/tests/builder.rb +1 -1
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb +1 -1
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build.rb +2 -2
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runner/build.rb +1 -1
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runner.rb +2 -2
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
- data/sub/avm-eac_rails_base0/avm-eac_rails_base0.gemspec +1 -1
- data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
- data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +2 -2
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler/systemd_unit.rb +46 -0
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler.rb +17 -0
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit/service.rb +70 -0
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.rb +29 -0
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/systemd_unit.rb +57 -0
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
- data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler.service +12 -0
- data/sub/avm-eac_rails_base1/template/avm/eac_rails_base1/systemd_unit/tasks_scheduler_command.sh +6 -0
- data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +2 -2
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/core_update.rb +3 -3
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb +17 -2
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/Dockerfile.template +2 -8
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/Dockerfile_apache_setup +8 -0
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/start.sh.template +1 -1
- data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +1 -1
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/patches/i18n.rb +1 -1
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/configured.rb +31 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/envvar.rb +17 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/rubocop/gemfile.rb +41 -0
- data/{lib/avm/ruby → sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1}/rubocop.rb +2 -2
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/tester.rb +1 -1
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update/sub_update.rb +1 -1
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/instances/base.rb +6 -0
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/version.rb +1 -1
- data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +1 -1
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance.rb +7 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
- data/sub/avm-files/avm-files.gemspec +1 -1
- data/sub/avm-files/lib/avm/files/appendable.rb +1 -1
- data/sub/avm-files/lib/avm/files/formatter/formats/ruby.rb +2 -2
- data/sub/avm-files/lib/avm/files/version.rb +1 -1
- data/sub/eac_cli/eac_cli.gemspec +1 -1
- data/sub/eac_cli/lib/eac_cli/old_configs/entry_reader.rb +1 -1
- data/sub/eac_cli/lib/eac_cli/old_configs/read_entry_options.rb +1 -1
- data/sub/eac_cli/lib/eac_cli/parser.rb +2 -2
- data/sub/eac_cli/lib/eac_cli/runner_with/help/builder.rb +1 -1
- data/sub/eac_cli/lib/eac_cli/runner_with/subcommands.rb +5 -5
- data/sub/eac_cli/lib/eac_cli/runner_with_set.rb +2 -2
- data/sub/eac_cli/lib/eac_cli/version.rb +1 -1
- data/sub/eac_config/eac_config.gemspec +1 -1
- data/sub/eac_config/lib/eac_config/entry.rb +1 -1
- data/sub/eac_config/lib/eac_config/envvars_node/entry.rb +1 -1
- data/sub/eac_config/lib/eac_config/paths_hash/node.rb +1 -1
- data/sub/eac_config/lib/eac_config/version.rb +1 -1
- data/sub/eac_fs/eac_fs.gemspec +1 -1
- data/sub/eac_fs/lib/eac_fs/version.rb +1 -1
- data/sub/eac_git/eac_git.gemspec +1 -1
- data/sub/eac_git/lib/eac_git/local/remote.rb +2 -2
- data/sub/eac_git/lib/eac_git/local.rb +1 -1
- data/sub/eac_git/lib/eac_git/version.rb +1 -1
- data/sub/eac_rest/eac_rest.gemspec +1 -1
- data/sub/eac_rest/lib/eac_rest/api.rb +14 -3
- data/sub/eac_rest/lib/eac_rest/request.rb +22 -1
- data/sub/eac_rest/lib/eac_rest/response.rb +41 -1
- data/sub/eac_rest/lib/eac_rest/version.rb +1 -1
- data/sub/eac_ruby_base0/eac_ruby_base0.gemspec +1 -1
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/application.rb +2 -2
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
- data/sub/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +1 -1
- data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/version_file.rb +2 -2
- data/sub/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
- data/sub/eac_ruby_utils/eac_ruby_utils.gemspec +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/custom_format.rb +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +16 -4
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/listable/value.rb +12 -2
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/local_time_zone.rb +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/debug.rb +6 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/on_clean_environment.rb +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp/{temp_spec.rb → directory_spec.rb} +0 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp_spec.rb +4 -4
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/listable_spec.rb +169 -106
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/options_consumer_spec.rb +52 -17
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/listable_spec.rb +5 -3
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/simple_cache_spec.rb +5 -3
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec.rb +3 -3
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb +21 -18
- data/sub/eac_ruby_utils/spec/locales/pt-BR.yml +3 -0
- data/sub/eac_templates/eac_templates.gemspec +1 -1
- data/sub/eac_templates/lib/eac_templates/directory.rb +1 -1
- data/sub/eac_templates/lib/eac_templates/version.rb +1 -1
- metadata +41 -21
- data/lib/avm/ruby/rubocop/_configured.rb +0 -29
- data/lib/avm/ruby/rubocop/_envvar.rb +0 -15
- data/lib/avm/ruby/rubocop/_gemfile.rb +0 -39
@@ -76,7 +76,7 @@ module Avm
|
|
76
76
|
|
77
77
|
def sync_content
|
78
78
|
::Avm::Sync.new(source_path, target_path)
|
79
|
-
|
79
|
+
.add_exclude('/*').add_includes(*target_files_to_remove).move_mode(true).run
|
80
80
|
end
|
81
81
|
|
82
82
|
# @return [EacFs::CachedDownload]
|
@@ -99,8 +99,8 @@ module Avm
|
|
99
99
|
|
100
100
|
def target_files_to_remove
|
101
101
|
git_repo.command('ls-files').execute!
|
102
|
-
|
103
|
-
|
102
|
+
.each_line.map { |v| "/#{v.strip}" }
|
103
|
+
.without(*TARGET_KEEP)
|
104
104
|
end
|
105
105
|
|
106
106
|
def target_path_uncached
|
@@ -12,7 +12,8 @@ module Avm
|
|
12
12
|
enable_simple_cache
|
13
13
|
|
14
14
|
BASE_IMAGE = 'ubuntu:20.04'
|
15
|
-
|
15
|
+
INSTALLER_TARGET_TASK_WITH_WEB_PATH_BLANK = 'redmine_as_apache_base'
|
16
|
+
INSTALLER_TARGET_TASK_WITH_WEB_PATH_PRESENT = 'redmine_as_apache_path'
|
16
17
|
DATABASE_INTERNAL_HOSTNAME = 'localhost'
|
17
18
|
REDMINE_SOURCE_HOST_SUBPATH = 'redmine_source'
|
18
19
|
|
@@ -20,6 +21,12 @@ module Avm
|
|
20
21
|
instance.id
|
21
22
|
end
|
22
23
|
|
24
|
+
def apache_setup
|
25
|
+
return '' if web_path_present?
|
26
|
+
|
27
|
+
template.child('Dockerfile_apache_setup').apply(self)
|
28
|
+
end
|
29
|
+
|
23
30
|
def base_image
|
24
31
|
eac_ubuntu_base0_instance.docker_image.provide.id
|
25
32
|
end
|
@@ -30,7 +37,11 @@ module Avm
|
|
30
37
|
end
|
31
38
|
|
32
39
|
def installer_target_task
|
33
|
-
|
40
|
+
if web_path_present?
|
41
|
+
INSTALLER_TARGET_TASK_WITH_WEB_PATH_PRESENT
|
42
|
+
else
|
43
|
+
INSTALLER_TARGET_TASK_WITH_WEB_PATH_BLANK
|
44
|
+
end
|
34
45
|
end
|
35
46
|
|
36
47
|
def redmine_user
|
@@ -53,6 +64,10 @@ module Avm
|
|
53
64
|
'/start.sh'
|
54
65
|
end
|
55
66
|
|
67
|
+
def web_path_present?
|
68
|
+
::Addressable::URI.parse(instance.web_url).path.present?
|
69
|
+
end
|
70
|
+
|
56
71
|
private
|
57
72
|
|
58
73
|
def eac_ubuntu_base0_instance
|
@@ -22,19 +22,13 @@ RUN SKIP_DATABASE='%%skip_database%%' \
|
|
22
22
|
'%%redmine_path%%/plugins/redmine_installer/installer/run.sh' '%%installer_target_task%%'
|
23
23
|
|
24
24
|
# Apache / Configuração do virtualhost
|
25
|
-
|
26
|
-
COPY apache_https_virtualhost.conf /etc/apache2/sites-available/redmine_ssl.conf
|
27
|
-
USER root
|
28
|
-
RUN a2ensite redmine
|
29
|
-
RUN a2ensite redmine_ssl
|
30
|
-
RUN a2dissite 000-default
|
31
|
-
RUN a2enmod ssl
|
32
|
-
RUN service apache2 restart
|
25
|
+
%%apache_setup%%
|
33
26
|
|
34
27
|
# Portas
|
35
28
|
EXPOSE 80/tcp 443/tcp 22/tcp
|
36
29
|
|
37
30
|
# Execução
|
31
|
+
USER root
|
38
32
|
COPY start.sh '%%start_path%%'
|
39
33
|
RUN /bin/chmod +x '%%start_path%%'
|
40
34
|
RUN /bin/chown '%%redmine_user%%:%%redmine_user%%' '%%start_path%%'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
COPY apache_http_virtualhost.conf /etc/apache2/sites-available/redmine.conf
|
2
|
+
COPY apache_https_virtualhost.conf /etc/apache2/sites-available/redmine_ssl.conf
|
3
|
+
USER root
|
4
|
+
RUN a2ensite redmine
|
5
|
+
RUN a2ensite redmine_ssl
|
6
|
+
RUN a2dissite 000-default
|
7
|
+
RUN a2enmod ssl
|
8
|
+
RUN service apache2 restart
|
@@ -17,5 +17,5 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.add_dependency 'eac_ruby_gems_utils', '~> 0.9', '>= 0.9.8'
|
18
18
|
s.add_dependency 'eac_ruby_utils', '~> 0.80'
|
19
19
|
|
20
|
-
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.
|
20
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
21
21
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/sources/configuration'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module EacRubyBase1
|
7
|
+
class Rubocop
|
8
|
+
module Configured
|
9
|
+
def configured_rubocop_command_uncached
|
10
|
+
configured_rubocop_command_by_command || configured_rubocop_command_by_gemfile
|
11
|
+
end
|
12
|
+
|
13
|
+
def configured_rubocop_command_by_command
|
14
|
+
configuration.if_present(&:rubocop_command)
|
15
|
+
end
|
16
|
+
|
17
|
+
def configured_rubocop_command_by_gemfile
|
18
|
+
configuration.if_present(&:rubocop_gemfile).if_present do |v|
|
19
|
+
rubocop_command_by_gemfile_path(v.parent)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def configuration_uncached
|
26
|
+
::Avm::Sources::Configuration.find_by_path(base_path)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module EacRubyBase1
|
7
|
+
class Rubocop
|
8
|
+
module Envvar
|
9
|
+
RUBOCOP_COMMAND_ENVVAR_NAME = 'RUBOCOP_COMMAND'
|
10
|
+
|
11
|
+
def env_rubocop_command
|
12
|
+
ENV[RUBOCOP_COMMAND_ENVVAR_NAME].present? ? cmd(ENV[RUBOCOP_COMMAND_ENVVAR_NAME]) : nil
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/patches/eac_ruby_gems_utils/gem'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacRubyBase1
|
8
|
+
class Rubocop
|
9
|
+
module Gemfile
|
10
|
+
def gemfile_rubocop_command
|
11
|
+
return nil unless rubocop_gemfile?
|
12
|
+
|
13
|
+
rubocop_command_by_gemfile_path(mygem.root)
|
14
|
+
end
|
15
|
+
|
16
|
+
def rubocop_command_by_gemfile_path(path)
|
17
|
+
::EacRubyGemsUtils::Gem.new(path).bundle('exec', 'rubocop').chdir_root
|
18
|
+
end
|
19
|
+
|
20
|
+
def rubocop_gemfile?
|
21
|
+
return false if mygem.blank?
|
22
|
+
|
23
|
+
mygem.bundle('install').execute!
|
24
|
+
mygem.gemfile_lock_gem_version('rubocop').present?
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def mygem_uncached
|
30
|
+
find_gem(::Pathname.new(base_path).expand_path)
|
31
|
+
end
|
32
|
+
|
33
|
+
def find_gem(path)
|
34
|
+
r = ::EacRubyGemsUtils::Gem.new(path)
|
35
|
+
return r if r.gemfile_path.exist?
|
36
|
+
return find_gem(path.dirname) unless path.root?
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -4,9 +4,9 @@ require 'eac_ruby_utils/core_ext'
|
|
4
4
|
require 'eac_ruby_utils/ruby/on_clean_environment'
|
5
5
|
|
6
6
|
module Avm
|
7
|
-
module
|
7
|
+
module EacRubyBase1
|
8
8
|
class Rubocop
|
9
|
-
require_sub __FILE__
|
9
|
+
require_sub __FILE__, include_modules: true
|
10
10
|
enable_speaker
|
11
11
|
enable_simple_cache
|
12
12
|
common_constructor :base_path, :rubocop_args
|
@@ -19,7 +19,7 @@ module Avm
|
|
19
19
|
# @return [EacRubyGemsUtils::Gem::Command, nil]
|
20
20
|
def bundle_test_command
|
21
21
|
source.read_configuration_as_shell_words(BUNDLE_TEST_COMMAND_CONFIGURATION_KEY)
|
22
|
-
|
22
|
+
.if_present { |args| the_gem.bundle(*args).chdir_root }
|
23
23
|
end
|
24
24
|
|
25
25
|
# @return [EacRubyGemsUtils::Gem::Command, nil]
|
@@ -18,7 +18,7 @@ module Avm
|
|
18
18
|
if commit.no_scm_changed_files.any?
|
19
19
|
commit = commit.reword(no_scm_update_commit_message)
|
20
20
|
source.scm.commit_if_change { source_update.bundle_update }
|
21
|
-
|
21
|
+
.if_present { |v| v.merge_with(commit) }
|
22
22
|
else
|
23
23
|
commit.reword(scm_update_commit_message)
|
24
24
|
end
|
@@ -10,6 +10,12 @@ module Avm
|
|
10
10
|
def docker_image_class
|
11
11
|
::Avm::EacUbuntuBase0::DockerImage
|
12
12
|
end
|
13
|
+
|
14
|
+
def file_sudo_write(path, content)
|
15
|
+
::EacRubyUtils::Envs.local.command('echo', content).pipe(
|
16
|
+
host_env.command('sudo', 'tee', path)
|
17
|
+
).execute!
|
18
|
+
end
|
13
19
|
end
|
14
20
|
end
|
15
21
|
end
|
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.add_dependency 'avm', '~> 0.1'
|
16
16
|
s.add_dependency 'avm-eac_generic_base0', '~> 0.1'
|
17
17
|
s.add_dependency 'avm-eac_postgresql_base0', '~> 0.1'
|
18
|
-
s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.
|
18
|
+
s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.3'
|
19
19
|
s.add_dependency 'eac_ruby_utils', '~> 0.68'
|
20
20
|
|
21
21
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
|
@@ -5,12 +5,14 @@ require 'avm/eac_postgresql_base0/instance_with'
|
|
5
5
|
require 'avm/data/instance/files_unit'
|
6
6
|
require 'avm/data/instance/package'
|
7
7
|
require 'avm/eac_webapp_base0/deploy/file_unit'
|
8
|
+
require 'avm/eac_ubuntu_base0/instances/base'
|
8
9
|
|
9
10
|
module Avm
|
10
11
|
module EacWebappBase0
|
11
12
|
class Instance < ::Avm::Instances::Base
|
12
13
|
require_sub __FILE__
|
13
14
|
include ::Avm::EacPostgresqlBase0::InstanceWith
|
15
|
+
enable_simple_cache
|
14
16
|
|
15
17
|
FILES_UNITS = [].freeze
|
16
18
|
|
@@ -45,6 +47,11 @@ module Avm
|
|
45
47
|
|
46
48
|
private
|
47
49
|
|
50
|
+
# @return [Avm::EacUbuntuBase0::Instances::Base]
|
51
|
+
def platform_instance_uncached
|
52
|
+
::Avm::EacUbuntuBase0::Instances::Base.by_id(id)
|
53
|
+
end
|
54
|
+
|
48
55
|
def files_units
|
49
56
|
self.class.const_get('FILES_UNITS').transform_values do |fs_path_subpath|
|
50
57
|
::Avm::Data::Instance::FilesUnit.new(self, fs_path_subpath)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/files/formatter/formats/generic_plain'
|
4
|
-
require 'avm/
|
4
|
+
require 'avm/eac_ruby_base1/rubocop'
|
5
5
|
|
6
6
|
module Avm
|
7
7
|
module Files
|
@@ -12,7 +12,7 @@ module Avm
|
|
12
12
|
VALID_TYPES = ['x-ruby'].freeze
|
13
13
|
|
14
14
|
def internal_apply(files)
|
15
|
-
::Avm::
|
15
|
+
::Avm::EacRubyBase1::Rubocop.new('.', ['-a', '--ignore-parent-exclusion'] + files).run
|
16
16
|
super(files)
|
17
17
|
end
|
18
18
|
end
|
data/sub/eac_cli/eac_cli.gemspec
CHANGED
@@ -19,12 +19,12 @@ module EacCli
|
|
19
19
|
|
20
20
|
def alternatives_parsed(error)
|
21
21
|
alternatives.select { |a| error == a.error? }.map(&:parsed).reverse
|
22
|
-
|
22
|
+
.inject(::EacRubyUtils::Struct.new) { |a, e| a.merge(e) }
|
23
23
|
end
|
24
24
|
|
25
25
|
def alternatives_uncached
|
26
26
|
definition.alternatives
|
27
|
-
|
27
|
+
.map { |alternative| ::EacCli::Parser::Alternative.new(alternative, argv) }
|
28
28
|
end
|
29
29
|
|
30
30
|
def first_error_uncached
|
@@ -54,7 +54,7 @@ module EacCli
|
|
54
54
|
def options_section
|
55
55
|
"Options:\n" +
|
56
56
|
definition.alternatives.flat_map(&:options)
|
57
|
-
|
57
|
+
.map { |option| IDENT + option_definition(option) + "\n" }.join
|
58
58
|
end
|
59
59
|
|
60
60
|
def usage_section
|
@@ -17,7 +17,7 @@ module EacCli
|
|
17
17
|
common_concern do
|
18
18
|
include ::EacCli::Runner
|
19
19
|
runner_definition.singleton_class
|
20
|
-
|
20
|
+
.include(::EacCli::RunnerWith::Subcommands::DefinitionConcern)
|
21
21
|
end
|
22
22
|
|
23
23
|
EXTRA_AVAILABLE_SUBCOMMANDS_METHOD_NAME = :extra_available_subcommands
|
@@ -28,9 +28,9 @@ module EacCli
|
|
28
28
|
|
29
29
|
def available_subcommands_auto
|
30
30
|
self.class.constants
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
.map { |name| [name.to_s.underscore.gsub('_', '-'), self.class.const_get(name)] }
|
32
|
+
.select { |c| ::EacCli::RunnerWith::Subcommands.runner?(c[1]) }
|
33
|
+
.to_h.with_indifferent_access
|
34
34
|
end
|
35
35
|
|
36
36
|
def available_subcommands_extra
|
@@ -95,7 +95,7 @@ module EacCli
|
|
95
95
|
raise(::EacCli::Parser::Error.new(
|
96
96
|
self.class.runner_definition, runner_context.argv,
|
97
97
|
"Subcommand \"#{subcommand_name}\" not found " \
|
98
|
-
"(Available: #{available_subcommands.keys}"
|
98
|
+
"(Available: #{available_subcommands.keys})"
|
99
99
|
))
|
100
100
|
end
|
101
101
|
|
@@ -32,8 +32,8 @@ module EacCli
|
|
32
32
|
|
33
33
|
def key_to_module(key)
|
34
34
|
namespace_set.lazy
|
35
|
-
|
36
|
-
|
35
|
+
.map { |namespace| key_to_module_in_namespace(namespace, key) }
|
36
|
+
.find(&:present?) ||
|
37
37
|
raise("Not module found with key \"#{key}\" (Namespaces: #{namespace_set})")
|
38
38
|
end
|
39
39
|
|
@@ -12,7 +12,7 @@ module EacConfig
|
|
12
12
|
class << self
|
13
13
|
def entry_path_to_envvar_name(path)
|
14
14
|
::EacConfig::EntryPath.assert(path).parts.join('_').gsub(/[^a-z0-9_]/i, '')
|
15
|
-
|
15
|
+
.gsub(/\A_+/, '').gsub(/_+\z/, '').gsub(/_{2,}/, '_').upcase
|
16
16
|
end
|
17
17
|
|
18
18
|
def from_value(string)
|
data/sub/eac_fs/eac_fs.gemspec
CHANGED
data/sub/eac_git/eac_git.gemspec
CHANGED
@@ -16,5 +16,5 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.add_dependency 'parseconfig', '~> 1.0', '>= 1.0.8'
|
17
17
|
|
18
18
|
s.add_development_dependency 'aranha-parsers', '~> 0.8', '>= 0.8.2'
|
19
|
-
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.
|
19
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
20
20
|
end
|
@@ -19,8 +19,8 @@ module EacGit
|
|
19
19
|
# @return [String, nil]
|
20
20
|
def url
|
21
21
|
local.command('remote', 'get-url', name)
|
22
|
-
|
23
|
-
|
22
|
+
.execute!(exit_outputs: { NO_SUCH_REMOTE_CODE => nil })
|
23
|
+
.if_present(nil, &:strip)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -110,7 +110,7 @@ module EacGit
|
|
110
110
|
# @return [Array<EacGit::Local::Subrepo>]
|
111
111
|
def subrepos
|
112
112
|
command('subrepo', '-q', 'status').execute!.split("\n").map(&:strip).select(&:present?)
|
113
|
-
|
113
|
+
.map { |subpath| subrepo(subpath) }
|
114
114
|
end
|
115
115
|
|
116
116
|
def to_s
|
@@ -8,11 +8,14 @@ module EacRest
|
|
8
8
|
# * self.issue_get_url_suffix(provider_issue_id)
|
9
9
|
class Api
|
10
10
|
require_sub __FILE__, include_modules: true
|
11
|
-
|
11
|
+
attr_accessor :ssl_verify
|
12
|
+
common_constructor :root_url, :username, :password, default: [nil, nil] do
|
13
|
+
self.ssl_verify = true
|
14
|
+
end
|
12
15
|
|
13
16
|
def request(service_url_suffix, headers = {}, &body_data_proc)
|
14
17
|
r = ::EacRest::Request.new(build_service_url(service_url_suffix),
|
15
|
-
body_data_proc)
|
18
|
+
body_data_proc).ssl_verify(ssl_verify)
|
16
19
|
headers.each { |name, value| r = r.header(name, value) }
|
17
20
|
r = r.autenticate(username, password) if username.present?
|
18
21
|
r
|
@@ -28,12 +31,20 @@ module EacRest
|
|
28
31
|
|
29
32
|
# @return [Addressable::URI]
|
30
33
|
def build_service_url(suffix)
|
31
|
-
|
34
|
+
r = ::Addressable::URI.parse(suffix)
|
35
|
+
return r if r.scheme.present?
|
36
|
+
|
37
|
+
s = build_service_url_suffix(suffix)
|
32
38
|
r = ::Addressable::URI.parse(root_url)
|
33
39
|
r.path += s.path
|
34
40
|
r.query_values = r.query_values(::Array).if_present([]) +
|
35
41
|
s.query_values(::Array).if_present([])
|
36
42
|
r
|
37
43
|
end
|
44
|
+
|
45
|
+
# @return [Addressable::URI]
|
46
|
+
def build_service_url_suffix(suffix)
|
47
|
+
::Addressable::URI.parse(suffix)
|
48
|
+
end
|
38
49
|
end
|
39
50
|
end
|