avm-tools 0.31.0 → 0.32.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/data/unit.rb +7 -1
- data/lib/avm/stereotypes/eac_redmine_base0/data_unit.rb +29 -0
- data/lib/avm/stereotypes/eac_redmine_base0/instance.rb +10 -2
- data/lib/avm/tools/runner/eac_redmine_base0/data.rb +27 -0
- data/lib/avm/tools/runner/eac_redmine_base0/data/dump.rb +16 -0
- data/lib/avm/tools/version.rb +1 -1
- metadata +13 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2f7b0d99cc8ad01cab62e8b140114290035e233b898fd34b7c4aa91be927a1a
|
4
|
+
data.tar.gz: e63aef5208960e0a69578669e120493e24cc52354b8a94dc018b49645c0211a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b61fd2e8df381376ee6ed62b5e269d1f2e3202b698ef72757246b140cfe86c8f7d8582fd8064b8cb1808769af9f557203eba90f133a7228677513f8a74e92a7
|
7
|
+
data.tar.gz: d2a648257b9440a06c032030a055d5bc26bb411728fa6275e5f7bed29b42134825f1cbdc7f30e415fb6a3982768943627ff058aaf197cfb020e9720e9a5d7443
|
data/lib/avm/data/unit.rb
CHANGED
@@ -62,7 +62,7 @@ module Avm
|
|
62
62
|
def dump(data_path)
|
63
63
|
run_callbacks :dump do
|
64
64
|
infom "Dumping unit \"#{name}\" to \"#{data_path}\"..."
|
65
|
-
|
65
|
+
do_dump(data_path)
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
@@ -73,6 +73,12 @@ module Avm
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
protected
|
77
|
+
|
78
|
+
def do_dump(data_path)
|
79
|
+
dump_command.execute!(output_file: data_path)
|
80
|
+
end
|
81
|
+
|
76
82
|
private
|
77
83
|
|
78
84
|
def unit_on_directory_path(directory, identifier)
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/data/instance/unit'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
require 'open-uri'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module Stereotypes
|
9
|
+
module EacRedmineBase0
|
10
|
+
class DataUnit < ::Avm::Data::Instance::Unit
|
11
|
+
common_constructor :instance
|
12
|
+
|
13
|
+
EXTENSION = '.tar'
|
14
|
+
|
15
|
+
def do_dump(data_path)
|
16
|
+
::File.open(data_path, 'wb') do |file|
|
17
|
+
file << URI.parse(export_url).read
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def export_url
|
22
|
+
uri = ::Addressable::URI.parse(instance.read_entry('web.url')) + '/backup/export'
|
23
|
+
uri.query_values = { key: instance.read_entry('admin.api_key') }
|
24
|
+
uri.to_s
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'avm/stereotypes/eac_redmine_base0/data_unit'
|
3
4
|
require 'avm/stereotypes/eac_ubuntu_base0/docker_image'
|
4
5
|
require 'avm/stereotypes/eac_webapp_base0/instance'
|
5
6
|
require 'avm/stereotypes/rails/instance'
|
@@ -10,8 +11,6 @@ module Avm
|
|
10
11
|
class Instance < ::Avm::Stereotypes::EacWebappBase0::Instance
|
11
12
|
include ::Avm::Stereotypes::Rails::Instance
|
12
13
|
|
13
|
-
FILES_UNITS = { files: 'files' }.freeze
|
14
|
-
|
15
14
|
def docker_image_class
|
16
15
|
::Avm::Stereotypes::EacUbuntuBase0::DockerImage
|
17
16
|
end
|
@@ -24,6 +23,15 @@ module Avm
|
|
24
23
|
'--publish', "#{read_entry(:https_port)}:443"
|
25
24
|
]
|
26
25
|
end
|
26
|
+
|
27
|
+
def data_package
|
28
|
+
@data_package ||= ::Avm::Data::Instance::Package.new(
|
29
|
+
self,
|
30
|
+
units: {
|
31
|
+
all: ::Avm::Stereotypes::EacRedmineBase0::DataUnit.new(self)
|
32
|
+
}
|
33
|
+
)
|
34
|
+
end
|
27
35
|
end
|
28
36
|
end
|
29
37
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/stereotypes/eac_webapp_base0/runner/data'
|
4
|
+
require 'eac_ruby_utils/console/docopt_runner'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Tools
|
8
|
+
class Runner < ::EacRubyUtils::Console::DocoptRunner
|
9
|
+
class EacRedmineBase0 < ::EacRubyUtils::Console::DocoptRunner
|
10
|
+
class Data < ::EacRubyUtils::Console::DocoptRunner
|
11
|
+
::EacRubyUtils.require_sub(__FILE__)
|
12
|
+
|
13
|
+
DOC = <<~DOCOPT
|
14
|
+
Data utilities for EacRailsBase0 instances.
|
15
|
+
|
16
|
+
Usage:
|
17
|
+
__PROGRAM__ __SUBCOMMANDS__
|
18
|
+
__PROGRAM__ -h | --help
|
19
|
+
|
20
|
+
Options:
|
21
|
+
-h --help Show this screen.
|
22
|
+
DOCOPT
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/stereotypes/eac_webapp_base0/runner/data/dump'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Tools
|
7
|
+
class Runner < ::EacRubyUtils::Console::DocoptRunner
|
8
|
+
class EacRedmineBase0 < ::EacRubyUtils::Console::DocoptRunner
|
9
|
+
class Data < ::EacRubyUtils::Console::DocoptRunner
|
10
|
+
class Dump < ::Avm::Stereotypes::EacWebappBase0::Runner::Data::Dump
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/avm/tools/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avm-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.32.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aranha-parsers
|
@@ -76,14 +76,20 @@ dependencies:
|
|
76
76
|
requirements:
|
77
77
|
- - "~>"
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
version: '0.
|
79
|
+
version: '0.18'
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.18.1
|
80
83
|
type: :runtime
|
81
84
|
prerelease: false
|
82
85
|
version_requirements: !ruby/object:Gem::Requirement
|
83
86
|
requirements:
|
84
87
|
- - "~>"
|
85
88
|
- !ruby/object:Gem::Version
|
86
|
-
version: '0.
|
89
|
+
version: '0.18'
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: 0.18.1
|
87
93
|
- !ruby/object:Gem::Dependency
|
88
94
|
name: filesize
|
89
95
|
requirement: !ruby/object:Gem::Requirement
|
@@ -236,6 +242,7 @@ files:
|
|
236
242
|
- lib/avm/stereotypes/eac_rails_base0/deploy.rb
|
237
243
|
- lib/avm/stereotypes/eac_rails_base0/instance.rb
|
238
244
|
- lib/avm/stereotypes/eac_redmine_base0.rb
|
245
|
+
- lib/avm/stereotypes/eac_redmine_base0/data_unit.rb
|
239
246
|
- lib/avm/stereotypes/eac_redmine_base0/deploy.rb
|
240
247
|
- lib/avm/stereotypes/eac_redmine_base0/instance.rb
|
241
248
|
- lib/avm/stereotypes/eac_ubuntu_base0.rb
|
@@ -269,6 +276,8 @@ files:
|
|
269
276
|
- lib/avm/tools/runner/eac_rails_base0/deploy.rb
|
270
277
|
- lib/avm/tools/runner/eac_redmine_base0.rb
|
271
278
|
- lib/avm/tools/runner/eac_redmine_base0/bundle.rb
|
279
|
+
- lib/avm/tools/runner/eac_redmine_base0/data.rb
|
280
|
+
- lib/avm/tools/runner/eac_redmine_base0/data/dump.rb
|
272
281
|
- lib/avm/tools/runner/eac_redmine_base0/deploy.rb
|
273
282
|
- lib/avm/tools/runner/eac_redmine_base0/docker.rb
|
274
283
|
- lib/avm/tools/runner/eac_wordpress_base0.rb
|