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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b16ebdd42a72fca522a1d9ee15607fd367205816b0120fae9335a4161c648d78
4
- data.tar.gz: 97fa9f4fc23ca7a8f8f948e5bbbce607236995ffffc7c8c18e2c929371d24cef
3
+ metadata.gz: b2f7b0d99cc8ad01cab62e8b140114290035e233b898fd34b7c4aa91be927a1a
4
+ data.tar.gz: e63aef5208960e0a69578669e120493e24cc52354b8a94dc018b49645c0211a0
5
5
  SHA512:
6
- metadata.gz: c2de01964e826aa3abd422adb772360d526b0b547ffa68c5bc16ce56e901d6272be6b4ed6c7a10f3a1dbe0af93c2f0b7dbb6379c66501aa144a11634f3dbccd9
7
- data.tar.gz: 62ae835eb68eb1b780c8c801393fa1345cfd8c053ad79f2c8fe401fc8817226b08d330f1f1b7a66675560736781f19403ad79ebcd2dfcd811f6cbc9c10b52874
6
+ metadata.gz: 3b61fd2e8df381376ee6ed62b5e269d1f2e3202b698ef72757246b140cfe86c8f7d8582fd8064b8cb1808769af9f557203eba90f133a7228677513f8a74e92a7
7
+ data.tar.gz: d2a648257b9440a06c032030a055d5bc26bb411728fa6275e5f7bed29b42134825f1cbdc7f30e415fb6a3982768943627ff058aaf197cfb020e9720e9a5d7443
@@ -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
- dump_command.execute!(output_file: data_path)
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.31.0'
5
+ VERSION = '0.32.0'
6
6
  end
7
7
  end
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.31.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-01-27 00:00:00.000000000 Z
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.17'
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.17'
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