eac_tools 0.47.2 → 0.48.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +55 -50
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec +2 -2
  5. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
  6. data/sub/avm-eac_php_base0/avm-eac_php_base0.gemspec +2 -2
  7. data/sub/avm-eac_php_base0/lib/avm/eac_php_base0/version.rb +1 -1
  8. data/sub/avm-eac_postgresql_base0/avm-eac_postgresql_base0.gemspec +1 -1
  9. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance/data_unit.rb +13 -7
  10. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance.rb +16 -1
  11. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/version.rb +1 -1
  12. data/sub/avm-eac_rails_base0/avm-eac_rails_base0.gemspec +2 -2
  13. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
  14. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +3 -3
  15. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/base.rb +1 -0
  16. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/bundle.rb +28 -0
  17. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/code_runner.rb +28 -0
  18. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/log.rb +45 -0
  19. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/logs/clear.rb +27 -0
  20. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/logs.rb +19 -0
  21. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/rails_server.rb +34 -0
  22. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/tasks_scheduler/systemd_unit.rb +48 -0
  23. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/runners/tasks_scheduler.rb +19 -0
  24. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/{runner.rb → instances/runners.rb} +4 -3
  25. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
  26. data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +3 -3
  27. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project_rename.rb +1 -1
  28. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  29. data/sub/avm-eac_ubuntu_base0/Gemfile +5 -0
  30. data/sub/avm-eac_ubuntu_base0/avm-eac_ubuntu_base0.gemspec +21 -0
  31. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/apache/resource.rb +59 -0
  32. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/apache.rb +26 -0
  33. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/docker_image.rb +29 -0
  34. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/instances/base.rb +22 -0
  35. data/sub/{avm-eac_redmine_base0/lib/avm/eac_redmine_base0/runners.rb → avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/instances.rb} +2 -2
  36. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/rspec/ssh_docker_server.rb +84 -0
  37. data/sub/{avm-eac_rails_base0/lib/avm/eac_rails_base0/runners.rb → avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/rspec.rb} +2 -2
  38. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/runners/base/docker.rb +19 -0
  39. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/runners/base.rb +28 -0
  40. data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/version.rb +7 -0
  41. data/sub/{avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/runners.rb → avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0.rb} +2 -4
  42. data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/docker_image_spec.rb +16 -0
  43. data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/runners/base/docker_spec.rb +14 -0
  44. data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/runners/base_spec.rb +7 -0
  45. data/sub/avm-eac_ubuntu_base0/spec/rubocop_spec.rb +3 -0
  46. data/sub/avm-eac_ubuntu_base0/spec/spec_helper.rb +4 -0
  47. data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/docker_image/Dockerfile.template +24 -0
  48. data/sub/{avm-tools/spec/spec_helper/stub_templates/stubbed_docker_server → avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server}/Dockerfile +0 -0
  49. data/sub/{avm-tools/spec/spec_helper/stub_templates/stubbed_docker_server → avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server}/id_rsa +0 -0
  50. data/sub/{avm-tools/spec/spec_helper/stub_templates/stubbed_docker_server → avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server}/id_rsa.pub +0 -0
  51. data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +2 -2
  52. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
  53. data/sub/avm-eac_wordpress_base0/avm-eac_wordpress_base0.gemspec +3 -3
  54. data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/version.rb +1 -1
  55. data/sub/avm-tools/avm-tools.gemspec +3 -3
  56. data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
  57. data/sub/avm-tools/spec/lib/avm/tools/runner/git/deploy_spec.rb +4 -2
  58. data/sub/eac_ruby_utils/eac_ruby_utils.gemspec +1 -0
  59. data/sub/eac_ruby_utils/lib/eac_ruby_utils/envs/composite_command.rb +14 -2
  60. data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +2 -1
  61. data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  62. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/{command_spec.rb → command/base_example.rb} +2 -5
  63. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/command/local_env_spec.rb +11 -0
  64. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/command/ssh_env_spec.rb +17 -0
  65. metadata +64 -66
  66. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/runners/base.rb +0 -13
  67. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/runners.rb +0 -11
  68. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/runners/base.rb +0 -26
  69. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/bundle.rb +0 -26
  70. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/code_runner.rb +0 -26
  71. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/log.rb +0 -43
  72. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/logs/clear.rb +0 -26
  73. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/logs.rb +0 -18
  74. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/rails_server.rb +0 -32
  75. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler/systemd_unit.rb +0 -46
  76. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/tasks_scheduler.rb +0 -17
  77. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/runners/base.rb +0 -25
  78. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner.rb +0 -12
  79. data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/runners/base.rb +0 -14
  80. data/sub/avm-tools/spec/spec_helper/stubbed_docker_server.rb +0 -93
  81. data/sub/avm-tools/spec/spec_helper/templates.rb +0 -5
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRailsBase1
7
+ module Instances
8
+ module Runners
9
+ class TasksScheduler
10
+ require_sub __FILE__
11
+
12
+ runner_with :help, :subcommands do
13
+ subcommands
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,12 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/eac_webapp_base0/runner'
4
3
  require 'eac_ruby_utils/core_ext'
5
4
 
6
5
  module Avm
7
6
  module EacRailsBase1
8
- class Runner < ::Avm::EacWebappBase0::Runner
9
- require_sub __FILE__
7
+ module Instances
8
+ module Runners
9
+ require_sub __FILE__
10
+ end
10
11
  end
11
12
  end
12
13
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRailsBase1
5
- VERSION = '0.7.1'
5
+ VERSION = '0.8.0'
6
6
  end
7
7
  end
@@ -14,12 +14,12 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.add_dependency 'avm', '~> 0.57'
16
16
  s.add_dependency 'avm-eac_generic_base0', '~> 0.8'
17
- s.add_dependency 'avm-eac_rails_base1', '~> 0.7', '>= 0.7.1'
17
+ s.add_dependency 'avm-eac_rails_base1', '~> 0.8'
18
18
  s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.3'
19
19
  s.add_dependency 'curb', '~> 0.9', '>= 0.9.11'
20
- s.add_dependency 'eac_fs', '~> 0.15'
20
+ s.add_dependency 'eac_fs', '~> 0.16'
21
21
  s.add_dependency 'eac_rest', '~> 0.6', '>= 0.6.1'
22
- s.add_dependency 'eac_ruby_utils', '~> 0.107', '>= 0.107.1'
22
+ s.add_dependency 'eac_ruby_utils', '~> 0.109'
23
23
 
24
24
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
25
25
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eac_cli/core_ext'
4
- require 'avm/eac_rails_base1/runner/code_runner'
4
+ require 'avm/eac_rails_base1/instances/runners/code_runner'
5
5
 
6
6
  module Avm
7
7
  module EacRedmineBase0
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRedmineBase0
5
- VERSION = '0.17.0'
5
+ VERSION = '0.18.0'
6
6
  end
7
7
  end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.push File.expand_path('lib', __dir__)
4
+
5
+ require 'avm/eac_ubuntu_base0/version'
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = 'avm-eac_ubuntu_base0'
9
+ s.version = Avm::EacUbuntuBase0::VERSION
10
+ s.authors = ['Put here the authors']
11
+ s.summary = 'Put here de description.'
12
+
13
+ s.files = Dir['{lib,template}/**/*']
14
+
15
+ s.add_dependency 'avm', '~> 0.57'
16
+ s.add_dependency 'eac_ruby_utils', '~> 0.109'
17
+ s.add_dependency 'eac_templates', '~> 0.3', '>= 0.3.2'
18
+
19
+ s.add_development_dependency 'avm-eac_ubuntu_base0'
20
+ s.add_development_dependency 'eac_ruby_gem_support', '~> 0.4'
21
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacUbuntuBase0
7
+ class Apache
8
+ class Resource
9
+ common_constructor :apache, :type, :directory_prefix, :name
10
+
11
+ def available_path
12
+ ::File.join(apache.etc_root, "#{directory_prefix}-available", "#{name}.conf")
13
+ end
14
+
15
+ def available?
16
+ apache.host_env.file(available_path).exist?
17
+ end
18
+
19
+ def disable
20
+ apache.host_env.command('sudo', "a2dis#{type}", name).execute!
21
+ end
22
+
23
+ def enable
24
+ apache.host_env.command('sudo', "a2en#{type}", name).execute!
25
+ end
26
+
27
+ def enabled_path
28
+ ::File.join(apache.etc_root, "#{directory_prefix}-enabled", "#{name}.conf")
29
+ end
30
+
31
+ def enabled?
32
+ apache.host_env.file(enabled_path).exist?
33
+ end
34
+
35
+ def remove
36
+ remove_disabled
37
+ remove_available
38
+ end
39
+
40
+ def remove_available
41
+ raise 'Remove enabled before' if enabled?
42
+
43
+ apache.host_env.command('sudo', 'rm', '-f', available_path).execute! if available?
44
+ end
45
+
46
+ def remove_disabled
47
+ disable if enabled?
48
+ apache.host_env.command('sudo', 'rm', '-f', enabled_path).execute! if enabled?
49
+ end
50
+
51
+ def write(content)
52
+ ::EacRubyUtils::Envs.local.command('echo', content).pipe(
53
+ apache.host_env.command('sudo', 'tee', available_path)
54
+ ).execute!
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacUbuntuBase0
7
+ class Apache
8
+ require_sub __FILE__
9
+ common_constructor :host_env
10
+
11
+ def etc_root
12
+ '/etc/apache2'
13
+ end
14
+
15
+ def service(command)
16
+ host_env.command('sudo', 'service', 'apache2', command)
17
+ end
18
+
19
+ { conf: :conf, site: :sites }.each do |type, directory_prefix|
20
+ define_method type do |name|
21
+ ::Avm::EacUbuntuBase0::Apache::Resource.new(self, type, directory_prefix, name)
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/docker/image'
4
+ require 'eac_templates/from_all_gems'
5
+ require 'eac_ruby_utils/core_ext'
6
+
7
+ module Avm
8
+ module EacUbuntuBase0
9
+ class DockerImage < ::Avm::Docker::Image
10
+ USER_NAME = 'myuser'
11
+
12
+ def stereotype_tag
13
+ 'eac_ubuntu_base0'
14
+ end
15
+
16
+ def user_home
17
+ ::File.join('/home', user_name)
18
+ end
19
+
20
+ def user_name
21
+ USER_NAME
22
+ end
23
+
24
+ def user_password
25
+ user_name
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_ubuntu_base0/docker_image'
4
+ require 'avm/instances/base'
5
+
6
+ module Avm
7
+ module EacUbuntuBase0
8
+ module Instances
9
+ class Base < ::Avm::Instances::Base
10
+ def docker_image_class
11
+ ::Avm::EacUbuntuBase0::DockerImage
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
19
+ end
20
+ end
21
+ end
22
+ end
@@ -3,8 +3,8 @@
3
3
  require 'eac_ruby_utils/core_ext'
4
4
 
5
5
  module Avm
6
- module EacRedmineBase0
7
- module Runners
6
+ module EacUbuntuBase0
7
+ module Instances
8
8
  require_sub __FILE__
9
9
  end
10
10
  end
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_docker/images/templatized'
4
+ require 'eac_ruby_utils/core_ext'
5
+ require 'eac_templates/core_ext'
6
+
7
+ module Avm
8
+ module EacUbuntuBase0
9
+ module Rspec
10
+ class SshDockerServer < ::EacDocker::Images::Templatized
11
+ # @return [EacRubyUtils::Envs::SshEnv]
12
+ def env
13
+ raise '@env is blank' if @env.blank?
14
+
15
+ @env
16
+ end
17
+
18
+ def on_run
19
+ on_container do
20
+ on_env do
21
+ yield
22
+ end
23
+ end
24
+ end
25
+
26
+ private
27
+
28
+ def container
29
+ raise '@container is blank' if @container.blank?
30
+
31
+ @container
32
+ end
33
+
34
+ def env_identity_file
35
+ template.child('id_rsa').path
36
+ end
37
+
38
+ def env_identity_file_good_permissions
39
+ r = ::EacRubyUtils::Fs::Temp.file
40
+ ::FileUtils.cp env_identity_file, r
41
+ r.chmod(0o600)
42
+ r
43
+ end
44
+
45
+ def close_env
46
+ @identity_file.remove
47
+ @env = nil
48
+ end
49
+
50
+ def on_env
51
+ open_env
52
+ begin
53
+ yield
54
+ ensure
55
+ close_env
56
+ end
57
+ end
58
+
59
+ def on_container
60
+ provide.container.temporary(true).on_detached do |container|
61
+ @container = container
62
+ begin
63
+ yield
64
+ ensure
65
+ @container = nil
66
+ end
67
+ end
68
+ end
69
+
70
+ def open_env
71
+ raise 'Environment already open' if @env.present?
72
+
73
+ @identity_file = env_identity_file_good_permissions
74
+ @env = ::EacRubyUtils::Envs::SshEnv.new(
75
+ "ssh://root@#{container.hostname}" \
76
+ '?StrictHostKeyChecking=no' \
77
+ '&BatchMode=yes' \
78
+ "&IdentityFile=#{@identity_file}"
79
+ )
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end
@@ -3,8 +3,8 @@
3
3
  require 'eac_ruby_utils/core_ext'
4
4
 
5
5
  module Avm
6
- module EacRailsBase0
7
- module Runners
6
+ module EacUbuntuBase0
7
+ module Rspec
8
8
  require_sub __FILE__
9
9
  end
10
10
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/docker/runner'
4
+ require 'avm/runners/base'
5
+ require 'eac_ruby_utils/struct'
6
+
7
+ module Avm
8
+ module EacUbuntuBase0
9
+ module Runners
10
+ class Base < ::Avm::Runners::Base
11
+ class Docker < ::Avm::Docker::Runner
12
+ def use_default_registry?
13
+ true
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/runners/base'
4
+ require 'avm/eac_ubuntu_base0/instances/base'
5
+ require 'eac_ruby_utils/patches/module/require_sub'
6
+
7
+ module Avm
8
+ module EacUbuntuBase0
9
+ module Runners
10
+ class Base < ::Avm::Runners::Base
11
+ enable_simple_cache
12
+ require_sub __FILE__
13
+
14
+ INSTANCE_ID = 'eac-ubuntu-base0_self'
15
+
16
+ runner_with :help, :subcommands do
17
+ subcommands
18
+ end
19
+
20
+ private
21
+
22
+ def instance_uncached
23
+ ::Avm::EacUbuntuBase0::Instances::Base.by_id(INSTANCE_ID)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module EacUbuntuBase0
5
+ VERSION = '0.4.0'
6
+ end
7
+ end
@@ -3,9 +3,7 @@
3
3
  require 'eac_ruby_utils/core_ext'
4
4
 
5
5
  module Avm
6
- module EacWordpressBase0
7
- module Runners
8
- require_sub __FILE__
9
- end
6
+ module EacUbuntuBase0
7
+ require_sub __FILE__
10
8
  end
11
9
  end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_ubuntu_base0/docker_image'
4
+ require 'eac_docker/images/base'
5
+ require 'eac_docker/registry'
6
+
7
+ ::RSpec.describe ::Avm::EacUbuntuBase0::DockerImage do
8
+ let(:registry) { ::EacDocker::Registry.new('stub') }
9
+ let(:instance) { described_class.new(registry) }
10
+
11
+ describe '#provide' do
12
+ it do
13
+ expect(instance.provide).to be_a(::EacDocker::Images::Base)
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_ubuntu_base0/runners/base'
4
+ require 'avm/eac_ubuntu_base0/runners/base/docker'
5
+
6
+ ::RSpec.describe ::Avm::EacUbuntuBase0::Runners::Base::Docker do
7
+ it do
8
+ expect { run_command('--registry-name', 'testing', '--image-name') }.not_to raise_error
9
+ end
10
+
11
+ def run_command(*argv)
12
+ ::Avm::EacUbuntuBase0::Runners::Base.run(argv: %w[docker] + argv)
13
+ end
14
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_ubuntu_base0/runners/base'
4
+
5
+ ::RSpec.describe ::Avm::EacUbuntuBase0::Runners::Base do
6
+ include_examples 'in_avm_registry', 'runners'
7
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ ::EacRubyUtils::Rspec.default_setup.describe_rubocop
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/rspec/default_setup'
4
+ ::EacRubyUtils::Rspec.default_setup_create(::File.expand_path('..', __dir__)).stub_avm_contexts
@@ -0,0 +1,24 @@
1
+ FROM ubuntu:20.04
2
+
3
+ # Base system update
4
+ RUN apt-get update -y
5
+ RUN apt-get dist-upgrade -y
6
+
7
+ # Timezone
8
+ RUN apt-get install -y tzdata
9
+ RUN ln -fs /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime
10
+ RUN dpkg-reconfigure --frontend noninteractive tzdata
11
+
12
+ # Default user
13
+ RUN /usr/sbin/useradd --shell /bin/bash --home-dir %%user_home%% --create-home %%user_name%%
14
+ RUN /bin/echo '%%user_name%%:%%user_password%%' | /usr/sbin/chpasswd
15
+ RUN /bin/chown %%user_name%%:%%user_name%% %%user_home%% -R
16
+
17
+ # Sudo
18
+ RUN apt-get install -y sudo
19
+ RUN /bin/echo "%%user_name%% ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/%%user_name%%_all_nopasswd && chmod 0440 /etc/sudoers.d/%%user_name%%_all_nopasswd
20
+
21
+ # Container
22
+ USER %%user_name%%
23
+ WORKDIR %%user_home%%
24
+ CMD /bin/bash
@@ -14,10 +14,10 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.add_dependency 'avm', '~> 0.57'
16
16
  s.add_dependency 'avm-eac_generic_base0', '~> 0.8'
17
- s.add_dependency 'avm-eac_postgresql_base0', '~> 0.2', '>= 0.2.1'
17
+ s.add_dependency 'avm-eac_postgresql_base0', '~> 0.2', '>= 0.2.2'
18
18
  s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.3'
19
19
  s.add_dependency 'avm-files', '~> 0.6'
20
- s.add_dependency 'eac_ruby_utils', '~> 0.107', '>= 0.107.1'
20
+ s.add_dependency 'eac_ruby_utils', '~> 0.109'
21
21
 
22
22
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
23
23
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacWebappBase0
5
- VERSION = '0.12.3'
5
+ VERSION = '0.13.0'
6
6
  end
7
7
  end
@@ -12,9 +12,9 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,template}/**/*']
14
14
 
15
- s.add_dependency 'avm', '~> 0.45'
16
- s.add_dependency 'avm-eac_webapp_base0', '~> 0.9'
17
- s.add_dependency 'eac_ruby_utils', '~> 0.104'
15
+ s.add_dependency 'avm', '~> 0.57'
16
+ s.add_dependency 'avm-eac_webapp_base0', '~> 0.13'
17
+ s.add_dependency 'eac_ruby_utils', '~> 0.109'
18
18
 
19
19
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5', '>= 0.5.1'
20
20
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacWordpressBase0
5
- VERSION = '0.2.1'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
@@ -16,8 +16,8 @@ Gem::Specification.new do |s|
16
16
 
17
17
  s.add_dependency 'aranha-parsers', '~> 0.14', '>= 0.14.4'
18
18
  s.add_dependency 'avm', '~> 0.57'
19
- s.add_dependency 'avm-eac_ruby_base1', '~> 0.27', '>= 0.27.1'
20
- s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.3'
19
+ s.add_dependency 'avm-eac_ruby_base1', '~> 0.27', '>= 0.27.3'
20
+ s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.4'
21
21
  s.add_dependency 'avm-files', '~> 0.6'
22
22
  s.add_dependency 'avm-git', '~> 0.10', '>= 0.10.1'
23
23
  s.add_dependency 'clipboard', '~> 1.3', '>= 1.3.6'
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
25
25
  s.add_dependency 'eac_git', '~> 0.14'
26
26
  s.add_dependency 'eac_ruby_base0', '~> 0.17', '>= 0.17.1'
27
27
  s.add_dependency 'eac_templates', '~> 0.3', '>= 0.3.2'
28
- s.add_dependency 'git', '~> 1.12'
28
+ s.add_dependency 'git', '~> 1.13'
29
29
  s.add_dependency 'ruby-progressbar', '~> 1.11'
30
30
 
31
31
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.142.7'
5
+ VERSION = '0.142.8'
6
6
  end
7
7
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/eac_ubuntu_base0/rspec/ssh_docker_server'
3
4
  require 'avm/tools/runner'
4
5
  require 'tmpdir'
5
6
 
@@ -86,7 +87,8 @@ require 'tmpdir'
86
87
  end
87
88
 
88
89
  context 'with ssh target', docker: true do
89
- let(:env) { ::StubbedDockerServer.env }
90
+ let(:ssh_server) { ::Avm::EacUbuntuBase0::Rspec::SshDockerServer.new }
91
+ let(:env) { ssh_server.env }
90
92
  let(:tmpdir) { env.command('mktemp', '-d').execute! }
91
93
  let(:target_dir) { ::File.join(tmpdir, 'target') }
92
94
  let(:target_url) do
@@ -96,7 +98,7 @@ require 'tmpdir'
96
98
  end
97
99
 
98
100
  around do |example|
99
- ::StubbedDockerServer.on_run(&example)
101
+ ssh_server.on_run(&example)
100
102
  end
101
103
 
102
104
  before do
@@ -20,5 +20,6 @@ Gem::Specification.new do |s|
20
20
  s.add_dependency 'bundler'
21
21
  s.add_dependency 'filesize', '~> 0.2'
22
22
  s.add_dependency 'net-ssh', '~> 4.2'
23
+ s.add_development_dependency 'avm-eac_ubuntu_base0', '~> 0.4'
23
24
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
24
25
  end
@@ -25,8 +25,20 @@ module EacRubyUtils
25
25
 
26
26
  # @return [String]
27
27
  def bash_command
28
- ['set', '-euo', 'pipefail', OPERATOR_BEFORE, left_command.command, operator,
29
- right_command.command].join(' ')
28
+ ['set', '-euo', 'pipefail', OPERATOR_BEFORE, left_command_line, operator,
29
+ right_command_line].join(' ')
30
+ end
31
+
32
+ def left_command_line
33
+ left_command.command_line_without_env
34
+ end
35
+
36
+ def right_command_line
37
+ if right_command.env == left_command.env
38
+ right_command.command_line_without_env
39
+ else
40
+ right_command.command
41
+ end
30
42
  end
31
43
  end
32
44
  end
@@ -69,8 +69,9 @@ module EacRubyUtils
69
69
  .result
70
70
  end
71
71
 
72
+ # @return [Array<Gem::Dependency>]
72
73
  def gem_item_dependencies(item)
73
- ::Gem::Specification.find_by_name(item.name).dependencies
74
+ ::Gem::Specification.find_by_name(item.name).dependencies.select(&:runtime?)
74
75
  rescue ::Gem::MissingSpecError
75
76
  []
76
77
  end