eac_tools 0.86.9 → 0.86.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +9 -14
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm-eac_wordpress_base0/Gemfile +2 -2
- data/sub/avm-eac_wordpress_base0/avm-eac_wordpress_base0.gemspec +5 -4
- data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/instances/base.rb +1 -1
- data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/version.rb +1 -1
- data/sub/avm-eac_wordpress_base0/spec/lib/avm/eac_wordpress_base0/instances/apache_host_spec.rb +6 -6
- data/sub/avm-eac_wordpress_base0/spec/rubocop_spec.rb +1 -1
- data/sub/avm-eac_wordpress_base0/spec/spec_helper.rb +2 -2
- metadata +3 -25
- data/sub/avm-eac_ubuntu_base0/Gemfile +0 -8
- data/sub/avm-eac_ubuntu_base0/avm-eac_ubuntu_base0.gemspec +0 -21
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/apache/resource.rb +0 -59
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/apache.rb +0 -26
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/docker_image.rb +0 -29
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/instances/base.rb +0 -28
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/instances.rb +0 -11
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/rspec/ssh_docker_server.rb +0 -82
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/rspec.rb +0 -11
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/runners/base/docker.rb +0 -19
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/runners/base.rb +0 -30
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/version.rb +0 -7
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0.rb +0 -9
- data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/docker_image_spec.rb +0 -16
- data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/runners/base/docker_spec.rb +0 -14
- data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/runners/base_spec.rb +0 -7
- data/sub/avm-eac_ubuntu_base0/spec/rubocop_spec.rb +0 -3
- data/sub/avm-eac_ubuntu_base0/spec/spec_helper.rb +0 -4
- data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/docker_image/Dockerfile.template +0 -25
- data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/Dockerfile +0 -24
- data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/id_rsa +0 -27
- data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/id_rsa.pub +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e6a9b023bd2381b6d46559230461be701f5cba32a448d7c77e1b7b85ad301a37
|
|
4
|
+
data.tar.gz: e781d7770b15c965badbb070551ab2119bb01b1206fd612665dbc95be497740d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6a2b74ed15fc9734acf72c96e36f39b20dd8ce4aa2bb38d76ff3f63cc78bac9ffdb8e6d60b7f5e5bdd8485dbb8a9d59d7ff48ddc3a95d16c0ce36f536543b947
|
|
7
|
+
data.tar.gz: 3989e86275cee4a1e7f478c49d438e6e76ab5946647b18d2d0d9ba39dda0a486d31279f22cbbc2e91d40a806f0a0cf1a494234e79ba73f0d6e61f6df5587178e
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
eac_tools (0.86.
|
|
4
|
+
eac_tools (0.86.10)
|
|
5
5
|
avm (~> 0.86, >= 0.86.2)
|
|
6
6
|
avm-eac_asciidoctor_base0 (~> 0.22)
|
|
7
7
|
avm-eac_generic_base0 (~> 0.12, >= 0.12.2)
|
|
@@ -17,26 +17,18 @@ PATH
|
|
|
17
17
|
avm-eac_redmine_plugin_base0 (~> 0.4, >= 0.4.1)
|
|
18
18
|
avm-eac_ruby_base1 (~> 0.33, >= 0.33.1)
|
|
19
19
|
avm-eac_webapp_base0 (~> 0.18, >= 0.18.4)
|
|
20
|
-
avm-eac_wordpress_base0 (~> 0.3, >= 0.3.
|
|
20
|
+
avm-eac_wordpress_base0 (~> 0.3, >= 0.3.2)
|
|
21
21
|
avm-git (~> 0.17)
|
|
22
22
|
avm-tools (~> 0.161)
|
|
23
23
|
eac_ruby_utils (~> 0.121)
|
|
24
24
|
|
|
25
25
|
PATH
|
|
26
|
-
remote: sub/avm-
|
|
26
|
+
remote: sub/avm-eac_wordpress_base0
|
|
27
27
|
specs:
|
|
28
|
-
avm-
|
|
28
|
+
avm-eac_wordpress_base0 (0.3.2)
|
|
29
29
|
avm (~> 0.86, >= 0.86.2)
|
|
30
|
+
avm-eac_webapp_base0 (~> 0.18, >= 0.18.4)
|
|
30
31
|
eac_ruby_utils (~> 0.121)
|
|
31
|
-
eac_templates (~> 0.5, >= 0.5.1)
|
|
32
|
-
|
|
33
|
-
PATH
|
|
34
|
-
remote: sub/avm-eac_wordpress_base0
|
|
35
|
-
specs:
|
|
36
|
-
avm-eac_wordpress_base0 (0.3.1)
|
|
37
|
-
avm (~> 0.67)
|
|
38
|
-
avm-eac_webapp_base0 (~> 0.15)
|
|
39
|
-
eac_ruby_utils (~> 0.112)
|
|
40
32
|
|
|
41
33
|
GEM
|
|
42
34
|
remote: https://rubygems.org/
|
|
@@ -124,6 +116,10 @@ GEM
|
|
|
124
116
|
avm-eac_generic_base0 (~> 0.12, >= 0.12.1)
|
|
125
117
|
eac_envs-http (~> 0.4, >= 0.4.1)
|
|
126
118
|
eac_ruby_utils (~> 0.119, >= 0.119.2)
|
|
119
|
+
avm-eac_ubuntu_base0 (0.5.1)
|
|
120
|
+
avm (~> 0.86, >= 0.86.2)
|
|
121
|
+
eac_ruby_utils (~> 0.121)
|
|
122
|
+
eac_templates (~> 0.5, >= 0.5.1)
|
|
127
123
|
avm-eac_webapp_base0 (0.18.4)
|
|
128
124
|
avm (~> 0.86, >= 0.86.2)
|
|
129
125
|
avm-eac_generic_base0 (~> 0.12, >= 0.12.2)
|
|
@@ -319,7 +315,6 @@ PLATFORMS
|
|
|
319
315
|
x86_64-linux
|
|
320
316
|
|
|
321
317
|
DEPENDENCIES
|
|
322
|
-
avm-eac_ubuntu_base0!
|
|
323
318
|
avm-eac_wordpress_base0!
|
|
324
319
|
eac_ruby_gem_support (~> 0.10)
|
|
325
320
|
eac_tools!
|
data/lib/eac_tools/version.rb
CHANGED
|
@@ -4,5 +4,5 @@ source 'https://rubygems.org'
|
|
|
4
4
|
|
|
5
5
|
gemspec
|
|
6
6
|
|
|
7
|
-
local_gemfile =
|
|
8
|
-
eval_gemfile local_gemfile if
|
|
7
|
+
local_gemfile = File.join(File.dirname(__FILE__), 'Gemfile.local')
|
|
8
|
+
eval_gemfile local_gemfile if File.exist?(local_gemfile)
|
|
@@ -11,10 +11,11 @@ Gem::Specification.new do |s|
|
|
|
11
11
|
s.summary = 'Put here de description.'
|
|
12
12
|
|
|
13
13
|
s.files = Dir['{lib,template}/**/*']
|
|
14
|
+
s.required_ruby_version = '>= 2.7'
|
|
14
15
|
|
|
15
|
-
s.add_dependency 'avm', '~> 0.
|
|
16
|
-
s.add_dependency 'avm-eac_webapp_base0', '~> 0.
|
|
17
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
|
16
|
+
s.add_dependency 'avm', '~> 0.86', '>= 0.86.2'
|
|
17
|
+
s.add_dependency 'avm-eac_webapp_base0', '~> 0.18', '>= 0.18.4'
|
|
18
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.121'
|
|
18
19
|
|
|
19
|
-
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.
|
|
20
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.10'
|
|
20
21
|
end
|
|
@@ -21,7 +21,7 @@ module Avm
|
|
|
21
21
|
web_url = read_entry(::Avm::Instances::EntryKeys::WEB_URL)
|
|
22
22
|
super.after_load do
|
|
23
23
|
info 'Fixing web addresses...'
|
|
24
|
-
run_sql(<<~SQL)
|
|
24
|
+
run_sql(<<~SQL.squish)
|
|
25
25
|
update wp_options
|
|
26
26
|
set option_value = '#{web_url}'
|
|
27
27
|
where option_name in ('siteurl', 'home')
|
data/sub/avm-eac_wordpress_base0/spec/lib/avm/eac_wordpress_base0/instances/apache_host_spec.rb
CHANGED
|
@@ -4,18 +4,18 @@ require 'avm/instances/entry_keys'
|
|
|
4
4
|
require 'avm/eac_wordpress_base0/instances/apache_host'
|
|
5
5
|
require 'avm/eac_wordpress_base0/instances/base'
|
|
6
6
|
|
|
7
|
-
RSpec.describe
|
|
7
|
+
RSpec.describe Avm::EacWordpressBase0::Instances::ApacheHost do
|
|
8
8
|
describe '#no_ssl_site_content' do
|
|
9
|
-
let(:instance) {
|
|
9
|
+
let(:instance) { Avm::EacWordpressBase0::Instances::Base.by_id('stub-app_0') }
|
|
10
10
|
let(:apache_host) { described_class.new(instance) }
|
|
11
11
|
let(:expected_content) do
|
|
12
|
-
|
|
12
|
+
File.read(File.join(__dir__, 'apache_host_spec_no_ssl_content.conf'))
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
before do
|
|
16
|
-
instance.entry(
|
|
17
|
-
instance.entry(
|
|
18
|
-
instance.entry(
|
|
16
|
+
instance.entry(Avm::Instances::EntryKeys::INSTALL_PATH).write('/path/to/stub-app_0')
|
|
17
|
+
instance.entry(Avm::Instances::EntryKeys::WEB_URL).write('http://stubapp.net')
|
|
18
|
+
instance.entry(Avm::Instances::EntryKeys::INSTALL_USERNAME).write('myuser')
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
it do
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'eac_ruby_utils/rspec/default_setup'
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
EacRubyUtils::Rspec.default_setup_create(File.expand_path('..', __dir__))
|
|
5
|
+
EacRubyUtils::Rspec.default_setup.stub_eac_config_node
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: eac_tools
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.86.
|
|
4
|
+
version: 0.86.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Put here the authors
|
|
@@ -289,7 +289,7 @@ dependencies:
|
|
|
289
289
|
version: '0.3'
|
|
290
290
|
- - ">="
|
|
291
291
|
- !ruby/object:Gem::Version
|
|
292
|
-
version: 0.3.
|
|
292
|
+
version: 0.3.2
|
|
293
293
|
type: :runtime
|
|
294
294
|
prerelease: false
|
|
295
295
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -299,7 +299,7 @@ dependencies:
|
|
|
299
299
|
version: '0.3'
|
|
300
300
|
- - ">="
|
|
301
301
|
- !ruby/object:Gem::Version
|
|
302
|
-
version: 0.3.
|
|
302
|
+
version: 0.3.2
|
|
303
303
|
- !ruby/object:Gem::Dependency
|
|
304
304
|
name: avm-git
|
|
305
305
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -366,28 +366,6 @@ files:
|
|
|
366
366
|
- Gemfile.lock
|
|
367
367
|
- lib/eac_tools.rb
|
|
368
368
|
- lib/eac_tools/version.rb
|
|
369
|
-
- sub/avm-eac_ubuntu_base0/Gemfile
|
|
370
|
-
- sub/avm-eac_ubuntu_base0/avm-eac_ubuntu_base0.gemspec
|
|
371
|
-
- sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0.rb
|
|
372
|
-
- sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/apache.rb
|
|
373
|
-
- sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/apache/resource.rb
|
|
374
|
-
- sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/docker_image.rb
|
|
375
|
-
- sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/instances.rb
|
|
376
|
-
- sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/instances/base.rb
|
|
377
|
-
- sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/rspec.rb
|
|
378
|
-
- sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/rspec/ssh_docker_server.rb
|
|
379
|
-
- sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/runners/base.rb
|
|
380
|
-
- sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/runners/base/docker.rb
|
|
381
|
-
- sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/version.rb
|
|
382
|
-
- sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/docker_image_spec.rb
|
|
383
|
-
- sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/runners/base/docker_spec.rb
|
|
384
|
-
- sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/runners/base_spec.rb
|
|
385
|
-
- sub/avm-eac_ubuntu_base0/spec/rubocop_spec.rb
|
|
386
|
-
- sub/avm-eac_ubuntu_base0/spec/spec_helper.rb
|
|
387
|
-
- sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/docker_image/Dockerfile.template
|
|
388
|
-
- sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/Dockerfile
|
|
389
|
-
- sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/id_rsa
|
|
390
|
-
- sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/id_rsa.pub
|
|
391
369
|
- sub/avm-eac_wordpress_base0/Gemfile
|
|
392
370
|
- sub/avm-eac_wordpress_base0/avm-eac_wordpress_base0.gemspec
|
|
393
371
|
- sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0.rb
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
s.required_ruby_version = '>= 2.7'
|
|
15
|
-
|
|
16
|
-
s.add_dependency 'avm', '~> 0.86', '>= 0.86.2'
|
|
17
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.121'
|
|
18
|
-
s.add_dependency 'eac_templates', '~> 0.5', '>= 0.5.1'
|
|
19
|
-
|
|
20
|
-
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.10'
|
|
21
|
-
end
|
|
@@ -1,59 +0,0 @@
|
|
|
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
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'avm/docker/image'
|
|
4
|
-
require 'eac_templates/sources/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
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'avm/eac_ubuntu_base0/apache'
|
|
4
|
-
require 'avm/eac_ubuntu_base0/docker_image'
|
|
5
|
-
require 'avm/instances/base'
|
|
6
|
-
|
|
7
|
-
module Avm
|
|
8
|
-
module EacUbuntuBase0
|
|
9
|
-
module Instances
|
|
10
|
-
class Base < ::Avm::Instances::Base
|
|
11
|
-
# @return [Avm::EacUbuntuBase0::Apache]
|
|
12
|
-
def apache
|
|
13
|
-
::Avm::EacUbuntuBase0::Apache.new(host_env)
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def docker_image_class
|
|
17
|
-
::Avm::EacUbuntuBase0::DockerImage
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def file_sudo_write(path, content)
|
|
21
|
-
::EacRubyUtils::Envs.local.command('echo', content).pipe(
|
|
22
|
-
host_env.command('sudo', 'tee', path)
|
|
23
|
-
).execute!
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,82 +0,0 @@
|
|
|
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(&block)
|
|
19
|
-
on_container do
|
|
20
|
-
on_env(&block)
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
private
|
|
25
|
-
|
|
26
|
-
def container
|
|
27
|
-
raise '@container is blank' if @container.blank?
|
|
28
|
-
|
|
29
|
-
@container
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def env_identity_file
|
|
33
|
-
template.child('id_rsa').path
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def env_identity_file_good_permissions
|
|
37
|
-
r = ::EacRubyUtils::Fs::Temp.file
|
|
38
|
-
::FileUtils.cp env_identity_file, r
|
|
39
|
-
r.chmod(0o600)
|
|
40
|
-
r
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def close_env
|
|
44
|
-
@identity_file.remove
|
|
45
|
-
@env = nil
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def on_env
|
|
49
|
-
open_env
|
|
50
|
-
begin
|
|
51
|
-
yield
|
|
52
|
-
ensure
|
|
53
|
-
close_env
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def on_container
|
|
58
|
-
provide.container.temporary(true).on_detached do |container|
|
|
59
|
-
@container = container
|
|
60
|
-
begin
|
|
61
|
-
yield
|
|
62
|
-
ensure
|
|
63
|
-
@container = nil
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
def open_env
|
|
69
|
-
raise 'Environment already open' if @env.present?
|
|
70
|
-
|
|
71
|
-
@identity_file = env_identity_file_good_permissions
|
|
72
|
-
@env = ::EacRubyUtils::Envs::SshEnv.new(
|
|
73
|
-
"ssh://root@#{container.hostname}" \
|
|
74
|
-
'?StrictHostKeyChecking=no' \
|
|
75
|
-
'&BatchMode=yes' \
|
|
76
|
-
"&IdentityFile=#{@identity_file}"
|
|
77
|
-
)
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
end
|
|
82
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
|
@@ -1,30 +0,0 @@
|
|
|
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
|
-
for_context :instance
|
|
21
|
-
|
|
22
|
-
private
|
|
23
|
-
|
|
24
|
-
def instance_uncached
|
|
25
|
-
::Avm::EacUbuntuBase0::Instances::Base.by_id(INSTANCE_ID)
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/docker_image/Dockerfile.template
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
FROM ubuntu:20.04
|
|
2
|
-
|
|
3
|
-
# Base system update
|
|
4
|
-
ENV DEBIAN_FRONTEND=noninteractive
|
|
5
|
-
RUN apt-get update -y
|
|
6
|
-
RUN apt-get dist-upgrade -y
|
|
7
|
-
|
|
8
|
-
# Timezone
|
|
9
|
-
RUN apt-get install -y tzdata
|
|
10
|
-
RUN ln -fs /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime
|
|
11
|
-
RUN dpkg-reconfigure --frontend noninteractive tzdata
|
|
12
|
-
|
|
13
|
-
# Default user
|
|
14
|
-
RUN /usr/sbin/useradd --shell /bin/bash --home-dir %%user_home%% --create-home %%user_name%%
|
|
15
|
-
RUN /bin/echo '%%user_name%%:%%user_password%%' | /usr/sbin/chpasswd
|
|
16
|
-
RUN /bin/chown %%user_name%%:%%user_name%% %%user_home%% -R
|
|
17
|
-
|
|
18
|
-
# Sudo
|
|
19
|
-
RUN apt-get install -y sudo
|
|
20
|
-
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
|
|
21
|
-
|
|
22
|
-
# Container
|
|
23
|
-
USER %%user_name%%
|
|
24
|
-
WORKDIR %%user_home%%
|
|
25
|
-
CMD /bin/bash
|
data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/Dockerfile
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
FROM ubuntu:18.04
|
|
2
|
-
MAINTAINER Aleksandar Diklic "https://github.com/rastasheep"
|
|
3
|
-
|
|
4
|
-
RUN apt-get update
|
|
5
|
-
|
|
6
|
-
RUN apt-get install -y openssh-server
|
|
7
|
-
RUN mkdir /var/run/sshd
|
|
8
|
-
|
|
9
|
-
RUN echo 'root:root' |chpasswd
|
|
10
|
-
|
|
11
|
-
RUN sed -ri 's/^#?PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
|
|
12
|
-
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
|
|
13
|
-
|
|
14
|
-
RUN mkdir /root/.ssh
|
|
15
|
-
ADD id_rsa /root/.ssh/id_rsa
|
|
16
|
-
ADD id_rsa.pub /root/.ssh/id_rsa.pub
|
|
17
|
-
ADD id_rsa.pub /root/.ssh/authorized_keys
|
|
18
|
-
|
|
19
|
-
RUN apt-get clean && \
|
|
20
|
-
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
21
|
-
|
|
22
|
-
EXPOSE 22
|
|
23
|
-
|
|
24
|
-
CMD ["/usr/sbin/sshd", "-D"]
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
-----BEGIN RSA PRIVATE KEY-----
|
|
2
|
-
MIIEowIBAAKCAQEAyZfl6Z+r/Is396PdKgYEWAf0O2xt7a1UwlaP7ozRvZjmmd/X
|
|
3
|
-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