avm-tools 0.88.0 → 0.89.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: 39cd843842c1fc4981f71fe88945db68e140b1aa6a7bdddeddd8b344c4215501
4
- data.tar.gz: 1fbe73dc1d4e2854e637fc6b697880e6ad192ecb62b4cad5d81612b1e8c22e88
3
+ metadata.gz: 9acbf7ad72627c97018d603c65da21c1875efea79caa7569059d5fd1aeb083e2
4
+ data.tar.gz: 8d0bb06826ece8223ed806348cf91f36c8117ebba3ceb05247b6947b54da44f0
5
5
  SHA512:
6
- metadata.gz: eba623387eb4320e93facda684c544565c2a3b1b0abca7902793df59416506068df6a3b6e0359e4ded1c40897cccb80629f23802dbbe9cc101e637726bf55297
7
- data.tar.gz: 4d9b78c8924c5879811517ba7089b74aa8aa5b60a35a99d00e57330431da9141a44123c68c62c191210d9df584cbb02bd881d3067302cc09f2ae3fcc893d3f32
6
+ metadata.gz: f249739403ccc5346e161f6481acd020d369a02b00b01da1b6c80addc6bcce58d2dc7724cf923929e146e3cac1b8e5e557e82f66cb9f501da8e44f30f358b5c8
7
+ data.tar.gz: a47f7c215bedfe5f870ba8a6bbbaf2e579c0c31b017546894c43e0421d75362b366dace3cfcd2bb9f72df7a3037866385b9c928e9389d558d0c39c1939928ea1
@@ -17,10 +17,16 @@ module Avm
17
17
 
18
18
  enable_console_speaker
19
19
  enable_simple_cache
20
- common_constructor :instance, :options, default: [{}]
20
+ enable_listable
21
+ lists.add_symbol :option, :appended_directories, :no_request_test, :reference
22
+ common_constructor :instance, :options, default: [{}] do
23
+ self.options = ::Avm::EacWebappBase0::Deploy.lists.option
24
+ .hash_keys_validate!(options.symbolize_keys)
25
+ end
21
26
 
22
- JOBS = %w[create_build_dir build_content append_instance_content write_on_target
23
- setup_files_units assert_instance_branch request_test].freeze
27
+ REQUEST_TEST_JOB = 'request_test'
28
+ JOBS = (%w[create_build_dir build_content append_instance_content write_on_target
29
+ setup_files_units assert_instance_branch] + [REQUEST_TEST_JOB]).freeze
24
30
  define_callbacks(*JOBS)
25
31
 
26
32
  def run
@@ -67,8 +73,14 @@ module Avm
67
73
 
68
74
  private
69
75
 
76
+ def jobs
77
+ r = JOBS.dup
78
+ r.delete(REQUEST_TEST_JOB) if options[OPTION_NO_REQUEST_TEST]
79
+ r
80
+ end
81
+
70
82
  def run_jobs
71
- JOBS.each do |job|
83
+ jobs.each do |job|
72
84
  run_callbacks job do
73
85
  send(job)
74
86
  end
@@ -17,7 +17,7 @@ module Avm
17
17
  end
18
18
 
19
19
  def appended_directories_from_options
20
- options[:appended_directories] || []
20
+ options[OPTION_APPENDED_DIRECTORIES] || []
21
21
  end
22
22
  end
23
23
  end
@@ -18,7 +18,7 @@ module Avm
18
18
  end
19
19
 
20
20
  def git_reference
21
- options[:reference] || DEFAULT_REFERENCE
21
+ options[OPTION_REFERENCE] || DEFAULT_REFERENCE
22
22
  end
23
23
 
24
24
  def git_reference_found_uncached
@@ -11,6 +11,8 @@ module Avm
11
11
  class Instance < ::Avm::Instances::Base
12
12
  include ::Avm::Postgresql::InstanceWith
13
13
 
14
+ FILES_UNITS = [].freeze
15
+
14
16
  def stereotype_name
15
17
  self.class.name.desconstantize.demodulize
16
18
  end
@@ -2,34 +2,25 @@
2
2
 
3
3
  require 'avm/instances/runner'
4
4
  require 'avm/path_string'
5
- require 'eac_ruby_utils/console/docopt_runner'
6
- require 'eac_ruby_utils/console/speaker'
5
+ require 'eac_cli/core_ext'
7
6
 
8
7
  module Avm
9
8
  module EacWebappBase0
10
9
  class Runner < ::Avm::Instances::Runner
11
- class Deploy < ::EacRubyUtils::Console::DocoptRunner
12
- include ::EacRubyUtils::Console::Speaker
13
-
14
- DOC = <<~DOCOPT
15
- Deploy for instance.
16
-
17
- Usage:
18
- __PROGRAM__ [options]
19
- __PROGRAM__ -h | --help
20
-
21
- Options:
22
- -h --help Show this screen.
23
- -r --reference=<git-reference> Git reference to deploy.
24
- -a --append-dirs=<append-dirs> Append directories to deploy (List separated by ":").
25
- DOCOPT
10
+ class Deploy
11
+ runner_with :help do
12
+ desc 'Deploy for instance.'
13
+ arg_opt '-r', '--reference', 'Git reference to deploy.'
14
+ arg_opt '-a', '--append-dirs', 'Append directories to deploy (List separated by ":").'
15
+ bool_opt '-T', '--no-request-test', 'Do not test web interface after deploy.'
16
+ end
26
17
 
27
18
  def deploy_class
28
- context(:stereotype_module).const_get('Deploy')
19
+ runner_context.call(:stereotype_module).const_get('Deploy')
29
20
  end
30
21
 
31
22
  def run
32
- result = deploy_class.new(context(:instance), deploy_options).run
23
+ result = deploy_class.new(runner_context.call(:instance), deploy_options).run
33
24
  if result.error?
34
25
  fatal_error result.to_s
35
26
  else
@@ -38,8 +29,9 @@ module Avm
38
29
  end
39
30
 
40
31
  def deploy_options
41
- { reference: options.fetch('--reference'),
42
- appended_directories: ::Avm::PathString.paths(options.fetch('--append-dirs')) }
32
+ { reference: parsed.reference,
33
+ appended_directories: ::Avm::PathString.paths(parsed.append_dirs),
34
+ no_request_test: parsed.no_request_test? }
43
35
  end
44
36
  end
45
37
  end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_webapp_base0/runner'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module Tools
8
+ class Runner
9
+ class EacWebappBase0 < ::Avm::EacWebappBase0::Runner
10
+ require_sub __FILE__
11
+ end
12
+ end
13
+ end
14
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.88.0'
5
+ VERSION = '0.89.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.88.0
4
+ version: 0.89.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: 2021-02-06 00:00:00.000000000 Z
11
+ date: 2021-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -504,6 +504,7 @@ files:
504
504
  - lib/avm/tools/runner/eac_redmine_base0/core_update.rb
505
505
  - lib/avm/tools/runner/eac_redmine_base0/docker.rb
506
506
  - lib/avm/tools/runner/eac_redmine_base0/project_rename.rb
507
+ - lib/avm/tools/runner/eac_webapp_base0.rb
507
508
  - lib/avm/tools/runner/eac_wordpress_base0.rb
508
509
  - lib/avm/tools/runner/eac_writings_base0.rb
509
510
  - lib/avm/tools/runner/eac_writings_base1.rb