eac_tools 0.22.0 → 0.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +43 -43
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/lib/avm/instances/base.rb +1 -1
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec +5 -5
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/base.rb +13 -0
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances.rb +11 -0
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
- data/sub/avm-eac_latex_base0/avm-eac_latex_base0.gemspec +3 -3
- data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/instances/base.rb +2 -2
- data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/version.rb +1 -1
- data/sub/avm-eac_rails_base0/avm-eac_rails_base0.gemspec +2 -2
- data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/instances/base.rb +13 -0
- data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/instances.rb +11 -0
- data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/runners/base.rb +1 -1
- data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
- data/sub/avm-eac_rails_base0/spec/lib/avm/eac_rails_base0/apache_host_spec.rb +2 -2
- data/sub/avm-eac_rails_base0/spec/lib/avm/eac_rails_base0/apache_path_spec.rb +2 -2
- data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +4 -4
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/base.rb +27 -0
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances.rb +11 -0
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/bundle.rb +1 -1
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner_with/rails_environment.rb +2 -2
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
- data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +6 -6
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb +48 -4
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances.rb +11 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/runners/base.rb +1 -1
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/runners.rb +11 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources.rb +11 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
- data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +4 -4
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/subcommand_parent.rb +26 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb +61 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data/dump.rb +65 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data/load.rb +57 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data.rb +19 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners.rb +13 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
- data/sub/avm-eac_wordpress_base0/avm-eac_wordpress_base0.gemspec +3 -3
- data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/instances/base.rb +2 -2
- data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/version.rb +1 -1
- metadata +31 -43
- data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instance.rb +0 -11
- data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/instance.rb +0 -11
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instance.rb +0 -25
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instance.rb +0 -57
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance/subcommand_parent.rb +0 -24
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instance.rb +0 -62
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/dump.rb +0 -63
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/load.rb +0 -55
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data.rb +0 -17
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/instances/base'
|
4
|
+
require 'avm/eac_postgresql_base0/instance_with'
|
5
|
+
require 'avm/data/instance/files_unit'
|
6
|
+
require 'avm/data/instance/package'
|
7
|
+
require 'avm/eac_webapp_base0/deploy/file_unit'
|
8
|
+
require 'avm/eac_webapp_base0/instances/runners'
|
9
|
+
require 'avm/eac_ubuntu_base0/instances/base'
|
10
|
+
|
11
|
+
module Avm
|
12
|
+
module EacWebappBase0
|
13
|
+
module Instances
|
14
|
+
class Base < ::Avm::Instances::Base
|
15
|
+
require_sub __FILE__
|
16
|
+
include ::Avm::EacPostgresqlBase0::InstanceWith
|
17
|
+
enable_simple_cache
|
18
|
+
|
19
|
+
FILES_UNITS = [].freeze
|
20
|
+
|
21
|
+
def data_dump(argv = [])
|
22
|
+
run_subcommand(data_dump_runner_class, argv)
|
23
|
+
end
|
24
|
+
|
25
|
+
def data_dump_runner_class
|
26
|
+
"#{stereotype_namespace_module}::Runner::Data::Dump".constantize
|
27
|
+
end
|
28
|
+
|
29
|
+
def run_subcommand(subcommand_class, argv)
|
30
|
+
subcommand_class.create(
|
31
|
+
argv: argv,
|
32
|
+
parent: ::Avm::EacWebappBase0::Instance::SubcommandParent.new(self)
|
33
|
+
).run
|
34
|
+
end
|
35
|
+
|
36
|
+
def data_package
|
37
|
+
@data_package ||= ::Avm::Data::Instance::Package.new(
|
38
|
+
self, units: { database: database_unit }.merge(files_units)
|
39
|
+
)
|
40
|
+
end
|
41
|
+
|
42
|
+
def database_unit
|
43
|
+
pg.data_unit
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
# @return [Avm::EacUbuntuBase0::Instances::Base]
|
49
|
+
def platform_instance_uncached
|
50
|
+
::Avm::EacUbuntuBase0::Instances::Base.by_id(id)
|
51
|
+
end
|
52
|
+
|
53
|
+
def files_units
|
54
|
+
self.class.const_get('FILES_UNITS').transform_values do |fs_path_subpath|
|
55
|
+
::Avm::Data::Instance::FilesUnit.new(self, fs_path_subpath)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/data/package/dump'
|
4
|
+
require 'eac_cli/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacWebappBase0
|
8
|
+
module Instances
|
9
|
+
module Runners
|
10
|
+
class Data
|
11
|
+
class Dump
|
12
|
+
DUMP_EXPIRE_TIME = 1.day
|
13
|
+
DEFAULT_DUMP_PATH_ENTRY_SUFFIX = 'data.default_dump_path'
|
14
|
+
NO_DUMP_MESSAGE = 'Dump "%s" already exist and rewrite options was no setted nor ' \
|
15
|
+
'dump was expired.'
|
16
|
+
|
17
|
+
runner_with :help do
|
18
|
+
desc 'Dump utility for EacRailsBase instance.'
|
19
|
+
bool_opt '-w', '--rewrite', 'Forces dump overwrite.'
|
20
|
+
arg_opt '-p', '--dump-path', 'Set DUMP_PATH variable.'
|
21
|
+
end
|
22
|
+
|
23
|
+
def run
|
24
|
+
infov 'Instance to dump', "#{instance} (#{instance.class})"
|
25
|
+
if package_dump.runnable?
|
26
|
+
package_dump.run
|
27
|
+
else
|
28
|
+
warn(package_dump.cannot_run_reason)
|
29
|
+
end
|
30
|
+
success("Dump path: \"#{dump_path}\"")
|
31
|
+
dump_path
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def instance
|
37
|
+
runner_context.call(:instance)
|
38
|
+
end
|
39
|
+
|
40
|
+
def package_dump_uncached
|
41
|
+
instance
|
42
|
+
.data_package.dump(dump_path, existing: package_dump_existing)
|
43
|
+
end
|
44
|
+
|
45
|
+
def dump_path
|
46
|
+
parsed.dump_path || default_dump_path
|
47
|
+
end
|
48
|
+
|
49
|
+
def default_dump_path
|
50
|
+
instance.read_entry(DEFAULT_DUMP_PATH_ENTRY_SUFFIX)
|
51
|
+
end
|
52
|
+
|
53
|
+
def package_dump_existing
|
54
|
+
if parsed.rewrite?
|
55
|
+
::Avm::Data::Package::Dump::EXISTING_ROTATE
|
56
|
+
else
|
57
|
+
::Avm::Data::Package::Dump::EXISTING_ROTATE_EXPIRED
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/core_ext/numeric/time'
|
4
|
+
require 'eac_cli/speaker'
|
5
|
+
require 'eac_ruby_utils/simple_cache'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module EacWebappBase0
|
9
|
+
module Instances
|
10
|
+
module Runners
|
11
|
+
class Data
|
12
|
+
class Load
|
13
|
+
runner_with :help do
|
14
|
+
desc 'Load utility for EacRailsBase instance.'
|
15
|
+
arg_opt '-S', '--source-instance', 'Informa a instância a ser extraída o dump.'
|
16
|
+
pos_arg :dump_path, optional: true
|
17
|
+
end
|
18
|
+
|
19
|
+
def run
|
20
|
+
return ::Dev::Result.error("Dump \"#{dump_path}\" does not exist") unless
|
21
|
+
::File.exist?(dump_path)
|
22
|
+
|
23
|
+
load_dump
|
24
|
+
success("Dump loaded from \"#{dump_path}\"")
|
25
|
+
end
|
26
|
+
|
27
|
+
def dump_path_uncached
|
28
|
+
return parsed.dump_path.to_s if parsed.dump_path.present?
|
29
|
+
return source_instance_dump_path if parsed.source_instance.present?
|
30
|
+
|
31
|
+
raise "Dump path unknown (Options: #{parsed})"
|
32
|
+
end
|
33
|
+
|
34
|
+
def source_instance_dump_path
|
35
|
+
runner_context.call(:instance).class.by_id(parsed.source_instance).data_dump
|
36
|
+
end
|
37
|
+
|
38
|
+
def load_dump
|
39
|
+
info "Loading dump \"#{dump_path}\"..."
|
40
|
+
package_load.run
|
41
|
+
end
|
42
|
+
|
43
|
+
def dump_instance_method
|
44
|
+
:dump_database
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def package_load_uncached
|
50
|
+
runner_context.call(:instance).data_package.load(dump_path)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_cli/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module EacWebappBase0
|
7
|
+
module Instances
|
8
|
+
module Runners
|
9
|
+
class Data
|
10
|
+
require_sub __FILE__
|
11
|
+
runner_with :help, :subcommands do
|
12
|
+
desc 'Data utilities for EacRailsBase0 instances.'
|
13
|
+
subcommands
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
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.35'
|
16
|
-
s.add_dependency 'avm-eac_webapp_base0', '~> 0.
|
17
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
15
|
+
s.add_dependency 'avm', '~> 0.35', '>= 0.35.1'
|
16
|
+
s.add_dependency 'avm-eac_webapp_base0', '~> 0.4'
|
17
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.98'
|
18
18
|
|
19
19
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5', '>= 0.5.1'
|
20
20
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/instances/entry_keys'
|
4
|
-
require 'avm/eac_webapp_base0/
|
4
|
+
require 'avm/eac_webapp_base0/instances/base'
|
5
5
|
|
6
6
|
module Avm
|
7
7
|
module EacWordpressBase0
|
8
8
|
module Instances
|
9
|
-
class Base < ::Avm::EacWebappBase0::
|
9
|
+
class Base < ::Avm::EacWebappBase0::Instances::Base
|
10
10
|
FILES_UNITS = { uploads: 'wp-content/uploads', themes: 'wp-content/themes' }.freeze
|
11
11
|
|
12
12
|
def database_unit
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.23.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Put here the authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avm
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
39
|
+
version: '0.5'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '0.
|
46
|
+
version: '0.5'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: avm-eac_generic_base0
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
version: '0.1'
|
68
68
|
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 0.1.
|
70
|
+
version: 0.1.2
|
71
71
|
type: :runtime
|
72
72
|
prerelease: false
|
73
73
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -77,61 +77,49 @@ dependencies:
|
|
77
77
|
version: '0.1'
|
78
78
|
- - ">="
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version: 0.1.
|
80
|
+
version: 0.1.2
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: avm-eac_rails_base0
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
85
|
- - "~>"
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version: '0.
|
88
|
-
- - ">="
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: 0.6.1
|
87
|
+
version: '0.7'
|
91
88
|
type: :runtime
|
92
89
|
prerelease: false
|
93
90
|
version_requirements: !ruby/object:Gem::Requirement
|
94
91
|
requirements:
|
95
92
|
- - "~>"
|
96
93
|
- !ruby/object:Gem::Version
|
97
|
-
version: '0.
|
98
|
-
- - ">="
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version: 0.6.1
|
94
|
+
version: '0.7'
|
101
95
|
- !ruby/object:Gem::Dependency
|
102
96
|
name: avm-eac_rails_base1
|
103
97
|
requirement: !ruby/object:Gem::Requirement
|
104
98
|
requirements:
|
105
99
|
- - "~>"
|
106
100
|
- !ruby/object:Gem::Version
|
107
|
-
version: '0.
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 0.4.2
|
101
|
+
version: '0.5'
|
111
102
|
type: :runtime
|
112
103
|
prerelease: false
|
113
104
|
version_requirements: !ruby/object:Gem::Requirement
|
114
105
|
requirements:
|
115
106
|
- - "~>"
|
116
107
|
- !ruby/object:Gem::Version
|
117
|
-
version: '0.
|
118
|
-
- - ">="
|
119
|
-
- !ruby/object:Gem::Version
|
120
|
-
version: 0.4.2
|
108
|
+
version: '0.5'
|
121
109
|
- !ruby/object:Gem::Dependency
|
122
110
|
name: avm-eac_redmine_base0
|
123
111
|
requirement: !ruby/object:Gem::Requirement
|
124
112
|
requirements:
|
125
113
|
- - "~>"
|
126
114
|
- !ruby/object:Gem::Version
|
127
|
-
version: '0.
|
115
|
+
version: '0.12'
|
128
116
|
type: :runtime
|
129
117
|
prerelease: false
|
130
118
|
version_requirements: !ruby/object:Gem::Requirement
|
131
119
|
requirements:
|
132
120
|
- - "~>"
|
133
121
|
- !ruby/object:Gem::Version
|
134
|
-
version: '0.
|
122
|
+
version: '0.12'
|
135
123
|
- !ruby/object:Gem::Dependency
|
136
124
|
name: avm-eac_redmine_plugin_base0
|
137
125
|
requirement: !ruby/object:Gem::Requirement
|
@@ -166,20 +154,14 @@ dependencies:
|
|
166
154
|
requirements:
|
167
155
|
- - "~>"
|
168
156
|
- !ruby/object:Gem::Version
|
169
|
-
version: '0.
|
170
|
-
- - ">="
|
171
|
-
- !ruby/object:Gem::Version
|
172
|
-
version: 0.3.1
|
157
|
+
version: '0.4'
|
173
158
|
type: :runtime
|
174
159
|
prerelease: false
|
175
160
|
version_requirements: !ruby/object:Gem::Requirement
|
176
161
|
requirements:
|
177
162
|
- - "~>"
|
178
163
|
- !ruby/object:Gem::Version
|
179
|
-
version: '0.
|
180
|
-
- - ">="
|
181
|
-
- !ruby/object:Gem::Version
|
182
|
-
version: 0.3.1
|
164
|
+
version: '0.4'
|
183
165
|
- !ruby/object:Gem::Dependency
|
184
166
|
name: avm-eac_wordpress_base0
|
185
167
|
requirement: !ruby/object:Gem::Requirement
|
@@ -189,7 +171,7 @@ dependencies:
|
|
189
171
|
version: '0.1'
|
190
172
|
- - ">="
|
191
173
|
- !ruby/object:Gem::Version
|
192
|
-
version: 0.1.
|
174
|
+
version: 0.1.2
|
193
175
|
type: :runtime
|
194
176
|
prerelease: false
|
195
177
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -199,7 +181,7 @@ dependencies:
|
|
199
181
|
version: '0.1'
|
200
182
|
- - ">="
|
201
183
|
- !ruby/object:Gem::Version
|
202
|
-
version: 0.1.
|
184
|
+
version: 0.1.2
|
203
185
|
- !ruby/object:Gem::Dependency
|
204
186
|
name: avm-tools
|
205
187
|
requirement: !ruby/object:Gem::Requirement
|
@@ -264,7 +246,8 @@ files:
|
|
264
246
|
- sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/apache_host.rb
|
265
247
|
- sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/apache_path.rb
|
266
248
|
- sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/deploy.rb
|
267
|
-
- sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/
|
249
|
+
- sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances.rb
|
250
|
+
- sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/base.rb
|
268
251
|
- sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/runners.rb
|
269
252
|
- sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/runners/base.rb
|
270
253
|
- sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources.rb
|
@@ -334,7 +317,8 @@ files:
|
|
334
317
|
- sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/apache_host.rb
|
335
318
|
- sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/apache_path.rb
|
336
319
|
- sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/deploy.rb
|
337
|
-
- sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/
|
320
|
+
- sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/instances.rb
|
321
|
+
- sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/instances/base.rb
|
338
322
|
- sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/runners.rb
|
339
323
|
- sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/runners/base.rb
|
340
324
|
- sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/source_generators/base.rb
|
@@ -380,7 +364,8 @@ files:
|
|
380
364
|
- sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec
|
381
365
|
- sub/avm-eac_rails_base1/lib/avm/eac_rails_base1.rb
|
382
366
|
- sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/apache_host.rb
|
383
|
-
- sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/
|
367
|
+
- sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances.rb
|
368
|
+
- sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/base.rb
|
384
369
|
- sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner.rb
|
385
370
|
- sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/bundle.rb
|
386
371
|
- sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/runner/code_runner.rb
|
@@ -408,14 +393,16 @@ files:
|
|
408
393
|
- sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/core_update.rb
|
409
394
|
- sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/data_unit.rb
|
410
395
|
- sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/deploy.rb
|
411
|
-
- sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/
|
396
|
+
- sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances.rb
|
412
397
|
- sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb
|
413
398
|
- sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb
|
414
399
|
- sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners.rb
|
415
400
|
- sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/docker.rb
|
416
401
|
- sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project_rename.rb
|
417
402
|
- sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/rest_api.rb
|
403
|
+
- sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/runners.rb
|
418
404
|
- sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/runners/base.rb
|
405
|
+
- sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources.rb
|
419
406
|
- sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/base.rb
|
420
407
|
- sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners.rb
|
421
408
|
- sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners/core_update.rb
|
@@ -549,14 +536,15 @@ files:
|
|
549
536
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/git_info.rb
|
550
537
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/version.rb
|
551
538
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/write_on_target.rb
|
552
|
-
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/
|
553
|
-
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/
|
539
|
+
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb
|
540
|
+
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/subcommand_parent.rb
|
541
|
+
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners.rb
|
542
|
+
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data.rb
|
543
|
+
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data/dump.rb
|
544
|
+
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data/load.rb
|
554
545
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner.rb
|
555
546
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/apache_host.rb
|
556
547
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/apache_path.rb
|
557
|
-
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data.rb
|
558
|
-
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/dump.rb
|
559
|
-
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/data/load.rb
|
560
548
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/runner/deploy.rb
|
561
549
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/sources.rb
|
562
550
|
- sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/sources/base.rb
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/eac_ruby_base1/sources/base'
|
4
|
-
require 'avm/eac_webapp_base0/instance'
|
5
|
-
|
6
|
-
module Avm
|
7
|
-
module EacRailsBase1
|
8
|
-
class Instance < ::Avm::EacWebappBase0::Instance
|
9
|
-
DEFAULT_RAILS_ENVIRONMENT = 'production'
|
10
|
-
|
11
|
-
def bundle(*args)
|
12
|
-
the_gem.bundle(*args).chdir_root.envvar('RAILS_ENV', DEFAULT_RAILS_ENVIRONMENT)
|
13
|
-
end
|
14
|
-
|
15
|
-
def rake(*args)
|
16
|
-
bundle('exec', 'rake', *args)
|
17
|
-
end
|
18
|
-
|
19
|
-
def the_gem
|
20
|
-
@the_gem ||= ::Avm::EacRubyBase1::Sources::Base.new(::File.join(read_entry('fs_path')))
|
21
|
-
.env_set(host_env)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'addressable/uri'
|
4
|
-
require 'avm/eac_redmine_base0/data_unit'
|
5
|
-
require 'avm/eac_redmine_base0/instances/docker_image'
|
6
|
-
require 'avm/eac_redmine_base0/rest_api'
|
7
|
-
require 'avm/eac_webapp_base0/instance'
|
8
|
-
require 'avm/eac_rails_base1/instance'
|
9
|
-
|
10
|
-
module Avm
|
11
|
-
module EacRedmineBase0
|
12
|
-
class Instance < ::Avm::EacRailsBase1::Instance
|
13
|
-
enable_simple_cache
|
14
|
-
|
15
|
-
FILES_UNITS = { files: 'files' }.freeze
|
16
|
-
|
17
|
-
def docker_image_class
|
18
|
-
::Avm::EacRedmineBase0::Instances::DockerImage
|
19
|
-
end
|
20
|
-
|
21
|
-
def docker_run_arguments
|
22
|
-
[
|
23
|
-
'--volume',
|
24
|
-
"#{read_entry(::Avm::Instances::EntryKeys::FS_PATH)}:/home/myuser/eac_redmine_base0",
|
25
|
-
'--publish', "#{read_entry(:ssh_port)}:22",
|
26
|
-
'--publish', "#{read_entry(:http_port)}:80",
|
27
|
-
'--publish', "#{read_entry(:https_port)}:443"
|
28
|
-
]
|
29
|
-
end
|
30
|
-
|
31
|
-
def data_package
|
32
|
-
@data_package ||= ::Avm::Data::Instance::Package.new(
|
33
|
-
self,
|
34
|
-
units: {
|
35
|
-
all: ::Avm::EacRedmineBase0::DataUnit.new(self)
|
36
|
-
}
|
37
|
-
)
|
38
|
-
end
|
39
|
-
|
40
|
-
# @return [Addressable::URI]
|
41
|
-
def root_url
|
42
|
-
r = ::Addressable::URI.parse(read_entry(::Avm::Instances::EntryKeys::WEB_URL))
|
43
|
-
r.query_values = nil
|
44
|
-
r
|
45
|
-
end
|
46
|
-
|
47
|
-
private
|
48
|
-
|
49
|
-
# @return [Avm::EacRedmineBase0::RestApi]
|
50
|
-
def rest_api_uncached
|
51
|
-
url = root_url
|
52
|
-
url.query_values = { key: read_entry('api.key') }
|
53
|
-
::Avm::EacRedmineBase0::RestApi.new(url)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'eac_ruby_utils/core_ext'
|
4
|
-
|
5
|
-
module Avm
|
6
|
-
module EacWebappBase0
|
7
|
-
class Instance < ::Avm::Instances::Base
|
8
|
-
class SubcommandParent
|
9
|
-
enable_simple_cache
|
10
|
-
common_constructor :instance
|
11
|
-
|
12
|
-
private
|
13
|
-
|
14
|
-
def runner_context_uncached
|
15
|
-
::EacCli::Runner::Context.new(self, argv: runner_argv)
|
16
|
-
end
|
17
|
-
|
18
|
-
def runner_argv
|
19
|
-
[instance.class.name.split('::')[-2].dasherize, instance.id]
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,62 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/instances/base'
|
4
|
-
require 'avm/eac_postgresql_base0/instance_with'
|
5
|
-
require 'avm/data/instance/files_unit'
|
6
|
-
require 'avm/data/instance/package'
|
7
|
-
require 'avm/eac_webapp_base0/deploy/file_unit'
|
8
|
-
require 'avm/eac_ubuntu_base0/instances/base'
|
9
|
-
|
10
|
-
module Avm
|
11
|
-
module EacWebappBase0
|
12
|
-
class Instance < ::Avm::Instances::Base
|
13
|
-
require_sub __FILE__
|
14
|
-
include ::Avm::EacPostgresqlBase0::InstanceWith
|
15
|
-
enable_simple_cache
|
16
|
-
|
17
|
-
FILES_UNITS = [].freeze
|
18
|
-
|
19
|
-
def stereotype_name
|
20
|
-
self.class.name.desconstantize.demodulize
|
21
|
-
end
|
22
|
-
|
23
|
-
def data_dump(argv = [])
|
24
|
-
run_subcommand(::Avm::Tools::Runner::EacWordpressBase0::Data::Dump, argv)
|
25
|
-
end
|
26
|
-
|
27
|
-
def data_dump_runner_class
|
28
|
-
"::Avm::Tools::Runner::#{stereotype_name}::Data::Dump".constantize
|
29
|
-
end
|
30
|
-
|
31
|
-
def run_subcommand(subcommand_class, argv)
|
32
|
-
subcommand_class.create(
|
33
|
-
argv: argv,
|
34
|
-
parent: ::Avm::EacWebappBase0::Instance::SubcommandParent.new(self)
|
35
|
-
).run
|
36
|
-
end
|
37
|
-
|
38
|
-
def data_package
|
39
|
-
@data_package ||= ::Avm::Data::Instance::Package.new(
|
40
|
-
self, units: { database: database_unit }.merge(files_units)
|
41
|
-
)
|
42
|
-
end
|
43
|
-
|
44
|
-
def database_unit
|
45
|
-
pg.data_unit
|
46
|
-
end
|
47
|
-
|
48
|
-
private
|
49
|
-
|
50
|
-
# @return [Avm::EacUbuntuBase0::Instances::Base]
|
51
|
-
def platform_instance_uncached
|
52
|
-
::Avm::EacUbuntuBase0::Instances::Base.by_id(id)
|
53
|
-
end
|
54
|
-
|
55
|
-
def files_units
|
56
|
-
self.class.const_get('FILES_UNITS').transform_values do |fs_path_subpath|
|
57
|
-
::Avm::Data::Instance::FilesUnit.new(self, fs_path_subpath)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|