avm-tools 0.67.0 → 0.69.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/eac_rails_base0/apache_host.rb +17 -0
  3. data/lib/avm/eac_rails_base0/deploy.rb +50 -0
  4. data/lib/avm/eac_rails_base0/instance.rb +14 -0
  5. data/lib/avm/eac_redmine_base0/deploy.rb +2 -2
  6. data/lib/avm/eac_redmine_base0/instance.rb +2 -2
  7. data/lib/avm/eac_webapp_base0/apache_host.rb +103 -0
  8. data/lib/avm/eac_webapp_base0/deploy.rb +102 -0
  9. data/lib/avm/eac_webapp_base0/deploy/appended_directories.rb +25 -0
  10. data/lib/avm/eac_webapp_base0/deploy/file_unit.rb +41 -0
  11. data/lib/avm/eac_webapp_base0/deploy/git_info.rb +49 -0
  12. data/lib/avm/eac_webapp_base0/deploy/version.rb +20 -0
  13. data/lib/avm/eac_webapp_base0/instance.rb +50 -0
  14. data/lib/avm/eac_webapp_base0/runner/apache_host.rb +39 -0
  15. data/lib/avm/eac_webapp_base0/runner/data.rb +25 -0
  16. data/lib/avm/eac_webapp_base0/runner/data/dump.rb +69 -0
  17. data/lib/avm/eac_webapp_base0/runner/data/load.rb +66 -0
  18. data/lib/avm/eac_webapp_base0/runner/deploy.rb +59 -0
  19. data/lib/avm/git/issue/complete/_git_subrepos.rb +1 -0
  20. data/lib/avm/local_projects/instance.rb +1 -1
  21. data/lib/avm/projects/stereotypes/git_subrepo/warp.rb +2 -2
  22. data/lib/avm/projects/stereotypes/rails_application.rb +2 -0
  23. data/lib/avm/projects/stereotypes/rails_application/local_project_mixin.rb +18 -0
  24. data/lib/avm/projects/stereotypes/rails_application/update.rb +14 -0
  25. data/lib/avm/stereotypes/eac_wordpress_base0/apache_host.rb +2 -2
  26. data/lib/avm/stereotypes/eac_wordpress_base0/deploy.rb +2 -2
  27. data/lib/avm/stereotypes/eac_wordpress_base0/instance.rb +2 -2
  28. data/lib/avm/tools/runner/eac_rails_base0.rb +2 -2
  29. data/lib/avm/tools/runner/eac_rails_base0/apache_host.rb +3 -26
  30. data/lib/avm/tools/runner/eac_rails_base0/data.rb +2 -2
  31. data/lib/avm/tools/runner/eac_rails_base0/deploy.rb +3 -3
  32. data/lib/avm/tools/runner/eac_redmine_base0/data.rb +1 -1
  33. data/lib/avm/tools/runner/eac_redmine_base0/data/dump.rb +2 -2
  34. data/lib/avm/tools/runner/eac_redmine_base0/deploy.rb +2 -2
  35. data/lib/avm/tools/runner/eac_redmine_base0/project_rename.rb +1 -0
  36. data/lib/avm/tools/runner/eac_wordpress_base0/apache_host.rb +3 -25
  37. data/lib/avm/tools/runner/eac_wordpress_base0/data.rb +2 -2
  38. data/lib/avm/tools/runner/eac_wordpress_base0/deploy.rb +2 -2
  39. data/lib/avm/tools/version.rb +1 -1
  40. data/lib/eac_launcher/git/sub_warp_base.rb +1 -1
  41. data/lib/eac_launcher/publish/base.rb +1 -1
  42. data/template/avm/{stereotypes/eac_rails_base0 → eac_rails_base0}/deploy/config/database.yml.template +0 -0
  43. data/template/avm/{stereotypes/eac_webapp_base0 → eac_webapp_base0}/apache_host/no_ssl.conf +0 -0
  44. data/template/avm/self/docker_image/Dockerfile +1 -1
  45. data/vendor/eac_cli/Gemfile +5 -0
  46. data/vendor/eac_cli/eac_cli.gemspec +18 -0
  47. data/vendor/eac_cli/lib/eac_cli.rb +7 -0
  48. data/vendor/eac_cli/lib/eac_cli/core_ext.rb +4 -0
  49. data/vendor/eac_cli/lib/eac_cli/default_runner.rb +14 -0
  50. data/vendor/eac_cli/lib/eac_cli/definition.rb +72 -0
  51. data/vendor/eac_cli/lib/eac_cli/definition/argument_option.rb +13 -0
  52. data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +26 -0
  53. data/vendor/eac_cli/lib/eac_cli/definition/boolean_option.rb +13 -0
  54. data/vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb +27 -0
  55. data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +77 -0
  56. data/vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb +45 -0
  57. data/vendor/eac_cli/lib/eac_cli/parser.rb +14 -0
  58. data/vendor/eac_cli/lib/eac_cli/parser/collector.rb +56 -0
  59. data/vendor/eac_cli/lib/eac_cli/parser/error.rb +15 -0
  60. data/vendor/eac_cli/lib/eac_cli/parser/options_collection.rb +105 -0
  61. data/vendor/eac_cli/lib/eac_cli/parser/parse_result.rb +21 -0
  62. data/vendor/eac_cli/lib/eac_cli/parser/positional_collection.rb +49 -0
  63. data/vendor/eac_cli/lib/eac_cli/patches.rb +4 -0
  64. data/vendor/eac_cli/lib/eac_cli/patches/object.rb +5 -0
  65. data/vendor/eac_cli/lib/eac_cli/patches/object/runner_with.rb +24 -0
  66. data/vendor/eac_cli/lib/eac_cli/runner.rb +87 -0
  67. data/vendor/eac_cli/lib/eac_cli/runner/context.rb +18 -0
  68. data/vendor/eac_cli/lib/eac_cli/runner_with.rb +9 -0
  69. data/vendor/eac_cli/lib/eac_cli/runner_with/help.rb +19 -0
  70. data/vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb +26 -0
  71. data/vendor/eac_cli/lib/eac_cli/version.rb +5 -0
  72. data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +70 -0
  73. data/vendor/eac_cli/spec/rubocop_spec.rb +7 -0
  74. data/vendor/eac_cli/spec/spec_helper.rb +100 -0
  75. data/vendor/eac_git/lib/eac_git/version.rb +1 -1
  76. data/vendor/eac_git/vendor/git-subrepo/lib/git-subrepo +9 -7
  77. data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +3 -3
  78. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +5 -1
  79. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
  80. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem.rb +10 -0
  81. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem/version_file.rb +6 -5
  82. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple.rb +5 -34
  83. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb +42 -0
  84. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/result.rb +25 -0
  85. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
  86. data/vendor/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec.rb +14 -0
  87. data/vendor/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec_files/a_version_file.rb +7 -0
  88. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern.rb +4 -4
  89. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner.rb +6 -0
  90. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_class_methods.rb +1 -1
  91. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_subcommands.rb +8 -2
  92. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +18 -0
  93. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/value.rb +3 -2
  94. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string.rb +4 -0
  95. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/inflector.rb +9 -0
  96. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/simple_cache.rb +6 -2
  97. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/struct.rb +53 -0
  98. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  99. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/inflector_spec.rb +15 -0
  100. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/struct_spec.rb +46 -0
  101. metadata +61 -18
  102. data/lib/avm/stereotypes/eac_rails_base0/apache_host.rb +0 -19
  103. data/lib/avm/stereotypes/eac_rails_base0/deploy.rb +0 -52
  104. data/lib/avm/stereotypes/eac_rails_base0/instance.rb +0 -16
  105. data/lib/avm/stereotypes/eac_webapp_base0/apache_host.rb +0 -97
  106. data/lib/avm/stereotypes/eac_webapp_base0/deploy.rb +0 -104
  107. data/lib/avm/stereotypes/eac_webapp_base0/deploy/appended_directories.rb +0 -27
  108. data/lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb +0 -43
  109. data/lib/avm/stereotypes/eac_webapp_base0/deploy/git_info.rb +0 -51
  110. data/lib/avm/stereotypes/eac_webapp_base0/deploy/version.rb +0 -22
  111. data/lib/avm/stereotypes/eac_webapp_base0/instance.rb +0 -52
  112. data/lib/avm/stereotypes/eac_webapp_base0/runner/data.rb +0 -27
  113. data/lib/avm/stereotypes/eac_webapp_base0/runner/data/dump.rb +0 -71
  114. data/lib/avm/stereotypes/eac_webapp_base0/runner/data/load.rb +0 -68
  115. data/lib/avm/stereotypes/eac_webapp_base0/runner/deploy.rb +0 -61
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyUtils
4
- VERSION = '0.44.0'
4
+ VERSION = '0.46.0'
5
5
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/inflector'
4
+
5
+ RSpec.describe ::EacRubyUtils::Inflector do
6
+ describe '#variableize' do
7
+ {
8
+ '_A_variableName' => 'a_variablename'
9
+ }.each do |source, expected|
10
+ context "when source is \"#{source}\"" do
11
+ it { expect(described_class.variableize(source)).to eq(expected) }
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/struct'
4
+
5
+ RSpec.describe ::EacRubyUtils::Struct do
6
+ let(:instance) { described_class.new(a: 1, b: '') }
7
+
8
+ describe '#[]' do
9
+ it { expect(instance[:a]).to eq(1) }
10
+ it { expect(instance['a']).to eq(1) }
11
+ it { expect(instance[:a?]).to eq(true) }
12
+ it { expect(instance['a?']).to eq(true) }
13
+ it { expect(instance[:b]).to eq('') }
14
+ it { expect(instance['b']).to eq('') }
15
+ it { expect(instance[:b?]).to eq(false) }
16
+ it { expect(instance['b?']).to eq(false) }
17
+ it { expect(instance[:c]).to eq(nil) }
18
+ it { expect(instance['c']).to eq(nil) }
19
+ it { expect(instance[:c?]).to eq(false) }
20
+ it { expect(instance['c?']).to eq(false) }
21
+ end
22
+
23
+ describe '#fetch' do
24
+ it { expect(instance.fetch(:a)).to eq(1) }
25
+ it { expect(instance.fetch('a')).to eq(1) }
26
+ it { expect(instance.fetch(:a?)).to eq(true) }
27
+ it { expect(instance.fetch('a?')).to eq(true) }
28
+ it { expect(instance.fetch(:b)).to eq('') }
29
+ it { expect(instance.fetch('b')).to eq('') }
30
+ it { expect(instance.fetch(:b?)).to eq(false) }
31
+ it { expect(instance.fetch('b?')).to eq(false) }
32
+ it { expect { instance.fetch(:c) }.to raise_error(::KeyError) }
33
+ it { expect { instance.fetch('c') }.to raise_error(::KeyError) }
34
+ it { expect { instance.fetch(:c?) }.to raise_error(::KeyError) }
35
+ it { expect { instance.fetch('c?') }.to raise_error(::KeyError) }
36
+ end
37
+
38
+ describe '#property_method' do
39
+ it { expect(instance.a).to eq(1) }
40
+ it { expect(instance.a?).to eq(true) }
41
+ it { expect(instance.b).to eq('') }
42
+ it { expect(instance.b?).to eq(false) }
43
+ it { expect { instance.c }.to raise_error(::NoMethodError) }
44
+ it { expect { instance.c? }.to raise_error(::NoMethodError) }
45
+ end
46
+ 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.67.0
4
+ version: 0.69.3
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-09-02 00:00:00.000000000 Z
11
+ date: 2020-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -290,10 +290,25 @@ files:
290
290
  - lib/avm/docker/image.rb
291
291
  - lib/avm/docker/registry.rb
292
292
  - lib/avm/docker/runner.rb
293
+ - lib/avm/eac_rails_base0/apache_host.rb
294
+ - lib/avm/eac_rails_base0/deploy.rb
295
+ - lib/avm/eac_rails_base0/instance.rb
293
296
  - lib/avm/eac_redmine_base0/core_update.rb
294
297
  - lib/avm/eac_redmine_base0/data_unit.rb
295
298
  - lib/avm/eac_redmine_base0/deploy.rb
296
299
  - lib/avm/eac_redmine_base0/instance.rb
300
+ - lib/avm/eac_webapp_base0/apache_host.rb
301
+ - lib/avm/eac_webapp_base0/deploy.rb
302
+ - lib/avm/eac_webapp_base0/deploy/appended_directories.rb
303
+ - lib/avm/eac_webapp_base0/deploy/file_unit.rb
304
+ - lib/avm/eac_webapp_base0/deploy/git_info.rb
305
+ - lib/avm/eac_webapp_base0/deploy/version.rb
306
+ - lib/avm/eac_webapp_base0/instance.rb
307
+ - lib/avm/eac_webapp_base0/runner/apache_host.rb
308
+ - lib/avm/eac_webapp_base0/runner/data.rb
309
+ - lib/avm/eac_webapp_base0/runner/data/dump.rb
310
+ - lib/avm/eac_webapp_base0/runner/data/load.rb
311
+ - lib/avm/eac_webapp_base0/runner/deploy.rb
297
312
  - lib/avm/executables.rb
298
313
  - lib/avm/files.rb
299
314
  - lib/avm/files/formatter.rb
@@ -397,6 +412,8 @@ files:
397
412
  - lib/avm/projects/stereotypes/git_subtree/publish.rb
398
413
  - lib/avm/projects/stereotypes/git_subtree/warp.rb
399
414
  - lib/avm/projects/stereotypes/rails_application.rb
415
+ - lib/avm/projects/stereotypes/rails_application/local_project_mixin.rb
416
+ - lib/avm/projects/stereotypes/rails_application/update.rb
400
417
  - lib/avm/projects/stereotypes/redmine_plugin.rb
401
418
  - lib/avm/projects/stereotypes/ruby_gem.rb
402
419
  - lib/avm/projects/stereotypes/ruby_gem/local_project_mixin.rb
@@ -421,26 +438,12 @@ files:
421
438
  - lib/avm/self/instance/entry_keys.rb
422
439
  - lib/avm/stereotypes.rb
423
440
  - lib/avm/stereotypes/eac_rails_base0.rb
424
- - lib/avm/stereotypes/eac_rails_base0/apache_host.rb
425
- - lib/avm/stereotypes/eac_rails_base0/deploy.rb
426
- - lib/avm/stereotypes/eac_rails_base0/instance.rb
427
441
  - lib/avm/stereotypes/eac_redmine_base0.rb
428
442
  - lib/avm/stereotypes/eac_ubuntu_base0.rb
429
443
  - lib/avm/stereotypes/eac_ubuntu_base0/apache.rb
430
444
  - lib/avm/stereotypes/eac_ubuntu_base0/apache/site.rb
431
445
  - lib/avm/stereotypes/eac_ubuntu_base0/docker_image.rb
432
446
  - lib/avm/stereotypes/eac_webapp_base0.rb
433
- - lib/avm/stereotypes/eac_webapp_base0/apache_host.rb
434
- - lib/avm/stereotypes/eac_webapp_base0/deploy.rb
435
- - lib/avm/stereotypes/eac_webapp_base0/deploy/appended_directories.rb
436
- - lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
437
- - lib/avm/stereotypes/eac_webapp_base0/deploy/git_info.rb
438
- - lib/avm/stereotypes/eac_webapp_base0/deploy/version.rb
439
- - lib/avm/stereotypes/eac_webapp_base0/instance.rb
440
- - lib/avm/stereotypes/eac_webapp_base0/runner/data.rb
441
- - lib/avm/stereotypes/eac_webapp_base0/runner/data/dump.rb
442
- - lib/avm/stereotypes/eac_webapp_base0/runner/data/load.rb
443
- - lib/avm/stereotypes/eac_webapp_base0/runner/deploy.rb
444
447
  - lib/avm/stereotypes/eac_wordpress_base0/apache_host.rb
445
448
  - lib/avm/stereotypes/eac_wordpress_base0/deploy.rb
446
449
  - lib/avm/stereotypes/eac_wordpress_base0/instance.rb
@@ -540,8 +543,10 @@ files:
540
543
  - lib/eac_launcher/vendor.rb
541
544
  - lib/eac_launcher/vendor/github.rb
542
545
  - lib/eac_launcher/version.rb
546
+ - template/avm/eac_rails_base0/deploy/config/database.yml.template
543
547
  - template/avm/eac_redmine_base0/deploy/config/install.sh.template
544
548
  - template/avm/eac_redmine_base0/deploy/config/secrets.yml
549
+ - template/avm/eac_webapp_base0/apache_host/no_ssl.conf
545
550
  - template/avm/ruby/gems/generator/gemspec.template
546
551
  - template/avm/ruby/gems/generator/root_lib.template
547
552
  - template/avm/ruby/gems/generator/static/Gemfile
@@ -550,10 +555,38 @@ files:
550
555
  - template/avm/ruby/gems/generator/version.template
551
556
  - template/avm/self/docker_image/Dockerfile
552
557
  - template/avm/self/docker_image/entrypoint.sh
553
- - template/avm/stereotypes/eac_rails_base0/deploy/config/database.yml.template
554
558
  - template/avm/stereotypes/eac_ubuntu_base0/docker_image/Dockerfile
555
- - template/avm/stereotypes/eac_webapp_base0/apache_host/no_ssl.conf
556
559
  - template/avm/stereotypes/eac_wordpress_base0/deploy/wp-config.php.template
560
+ - vendor/eac_cli/Gemfile
561
+ - vendor/eac_cli/eac_cli.gemspec
562
+ - vendor/eac_cli/lib/eac_cli.rb
563
+ - vendor/eac_cli/lib/eac_cli/core_ext.rb
564
+ - vendor/eac_cli/lib/eac_cli/default_runner.rb
565
+ - vendor/eac_cli/lib/eac_cli/definition.rb
566
+ - vendor/eac_cli/lib/eac_cli/definition/argument_option.rb
567
+ - vendor/eac_cli/lib/eac_cli/definition/base_option.rb
568
+ - vendor/eac_cli/lib/eac_cli/definition/boolean_option.rb
569
+ - vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb
570
+ - vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb
571
+ - vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb
572
+ - vendor/eac_cli/lib/eac_cli/parser.rb
573
+ - vendor/eac_cli/lib/eac_cli/parser/collector.rb
574
+ - vendor/eac_cli/lib/eac_cli/parser/error.rb
575
+ - vendor/eac_cli/lib/eac_cli/parser/options_collection.rb
576
+ - vendor/eac_cli/lib/eac_cli/parser/parse_result.rb
577
+ - vendor/eac_cli/lib/eac_cli/parser/positional_collection.rb
578
+ - vendor/eac_cli/lib/eac_cli/patches.rb
579
+ - vendor/eac_cli/lib/eac_cli/patches/object.rb
580
+ - vendor/eac_cli/lib/eac_cli/patches/object/runner_with.rb
581
+ - vendor/eac_cli/lib/eac_cli/runner.rb
582
+ - vendor/eac_cli/lib/eac_cli/runner/context.rb
583
+ - vendor/eac_cli/lib/eac_cli/runner_with.rb
584
+ - vendor/eac_cli/lib/eac_cli/runner_with/help.rb
585
+ - vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
586
+ - vendor/eac_cli/lib/eac_cli/version.rb
587
+ - vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb
588
+ - vendor/eac_cli/spec/rubocop_spec.rb
589
+ - vendor/eac_cli/spec/spec_helper.rb
557
590
  - vendor/eac_docker/Gemfile
558
591
  - vendor/eac_docker/eac_docker.gemspec
559
592
  - vendor/eac_docker/lib/eac_docker.rb
@@ -795,8 +828,12 @@ files:
795
828
  - vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/base.rb
796
829
  - vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/minitest.rb
797
830
  - vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple.rb
831
+ - vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb
832
+ - vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/result.rb
798
833
  - vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/rspec.rb
799
834
  - vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb
835
+ - vendor/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec.rb
836
+ - vendor/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec_files/a_version_file.rb
800
837
  - vendor/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem_spec.rb
801
838
  - vendor/eac_ruby_gems_utils/spec/rubocop_check_spec.rb
802
839
  - vendor/eac_ruby_gems_utils/spec/spec_helper.rb
@@ -865,6 +902,7 @@ files:
865
902
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/immutable/common_accessor.rb
866
903
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/immutable/hash_accessor.rb
867
904
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/immutable/instance_methods.rb
905
+ - vendor/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb
868
906
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/listable.rb
869
907
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/class_methods.rb
870
908
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/instance_methods.rb
@@ -903,6 +941,8 @@ files:
903
941
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb
904
942
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp.rb
905
943
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp/if_match.rb
944
+ - vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string.rb
945
+ - vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/inflector.rb
906
946
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time.rb
907
947
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/default_time_zone_set.rb
908
948
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/local_time_zone.rb
@@ -916,6 +956,7 @@ files:
916
956
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/ruby/on_clean_environment.rb
917
957
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider.rb
918
958
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/simple_cache.rb
959
+ - vendor/eac_ruby_utils/lib/eac_ruby_utils/struct.rb
919
960
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/templates.rb
920
961
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/directory.rb
921
962
  - vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/file.rb
@@ -942,6 +983,7 @@ files:
942
983
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/extname_spec.rb
943
984
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp/temp_spec.rb
944
985
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp_spec.rb
986
+ - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/inflector_spec.rb
945
987
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/listable_spec.rb
946
988
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/options_consumer_spec.rb
947
989
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerable/boolean_combinations_spec.rb
@@ -961,6 +1003,7 @@ files:
961
1003
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby_spec.rb
962
1004
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb
963
1005
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/simple_cache_spec.rb
1006
+ - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/struct_spec.rb
964
1007
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/file_spec.rb
965
1008
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/file_spec_files/expected_content
966
1009
  - vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/file_spec_files/source.template
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/stereotypes/eac_webapp_base0/apache_host'
4
-
5
- module Avm
6
- module Stereotypes
7
- module EacRailsBase0
8
- class ApacheHost < ::Avm::Stereotypes::EacWebappBase0::ApacheHost
9
- def document_root
10
- "#{instance.read_entry(:fs_path)}/public"
11
- end
12
-
13
- def extra_content
14
- 'PassengerEnabled On'
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,52 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/stereotypes/eac_webapp_base0/deploy'
4
-
5
- module Avm
6
- module Stereotypes
7
- module EacRailsBase0
8
- class Deploy < ::Avm::Stereotypes::EacWebappBase0::Deploy
9
- set_callback :assert_instance_branch, :after do
10
- bundle_install
11
- assert_database
12
- database_migrate
13
- compile_assets
14
- restart_tasks_scheduler
15
- touch_restart_file
16
- end
17
-
18
- def assert_database
19
- infom 'Asserting database...'
20
- instance.rake('db:create').system!
21
- end
22
-
23
- def bundle_install
24
- infom 'Running "bundle install"...'
25
- instance.bundle('install').system!
26
- end
27
-
28
- def compile_assets
29
- infom 'Compiling assets...'
30
- instance.rake('assets:clean', 'assets:precompile').system!
31
- end
32
-
33
- def database_migrate
34
- infom 'Running database migrations...'
35
- instance.rake('db:migrate').system!
36
- end
37
-
38
- def restart_tasks_scheduler
39
- infom 'Restarting Tasks Scheduler\'s daemon...'
40
- instance.bundle('exec', 'tasks_scheduler', 'restart').system!
41
- end
42
-
43
- def touch_restart_file
44
- infom 'Touching restart file...'
45
- instance.host_env.command(
46
- 'touch', ::File.join(instance.read_entry(:fs_path), 'tmp', 'restart.txt')
47
- ).system!
48
- end
49
- end
50
- end
51
- end
52
- end
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'avm/stereotypes/eac_webapp_base0/instance'
4
- require 'avm/stereotypes/rails/instance'
5
-
6
- module Avm
7
- module Stereotypes
8
- module EacRailsBase0
9
- class Instance < ::Avm::Stereotypes::EacWebappBase0::Instance
10
- include ::Avm::Stereotypes::Rails::Instance
11
-
12
- FILES_UNITS = { uploads: 'public/uploads' }.freeze
13
- end
14
- end
15
- end
16
- end
@@ -1,97 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'eac_ruby_utils/core_ext'
4
- require 'avm/patches/object/template'
5
- require 'avm/stereotypes/eac_ubuntu_base0/apache'
6
- require 'avm/patches/object/template'
7
-
8
- module Avm
9
- module Stereotypes
10
- module EacWebappBase0
11
- class ApacheHost
12
- enable_console_speaker
13
- enable_simple_cache
14
- common_constructor :instance
15
-
16
- def run
17
- write_available_no_ssl_site
18
- enable_no_ssl_site
19
- remove_ssl_site
20
- reload_apache
21
- run_certbot
22
- enable_ssl_site
23
- reload_apache
24
- ::Avm::Result.success('Done')
25
- end
26
-
27
- def no_ssl_site_content
28
- ::Avm::Stereotypes::EacWebappBase0::ApacheHost.template.child('no_ssl.conf')
29
- .apply(EntriesReader.new(self, instance))
30
- end
31
-
32
- private
33
-
34
- def apache_uncached
35
- ::Avm::Stereotypes::EacUbuntuBase0::Apache.new(instance.host_env)
36
- end
37
-
38
- def enable_no_ssl_site
39
- infom 'Enabling no SSL site...'
40
- no_ssl_site.enable
41
- end
42
-
43
- def enable_ssl_site
44
- infom 'Enabling SSL site...'
45
- ssl_site.enable
46
- end
47
-
48
- def no_ssl_site_uncached
49
- apache.site(instance.id)
50
- end
51
-
52
- def reload_apache
53
- infom 'Reloading Apache...'
54
- apache.service('reload')
55
- end
56
-
57
- def remove_ssl_site
58
- infom 'Removing SSL site...'
59
- ssl_site.remove
60
- end
61
-
62
- def run_certbot
63
- infom 'Running Certbot...'
64
- instance.host_env.command(
65
- 'sudo', 'certbot', '--apache', '--domain', instance.read_entry('web.hostname'),
66
- '--redirect', '--non-interactive', '--agree-tos',
67
- '--email', instance.read_entry('admin.email')
68
- ).system!
69
- end
70
-
71
- def ssl_site_uncached
72
- apache.site(no_ssl_site.name + '-le-ssl')
73
- end
74
-
75
- def write_available_no_ssl_site
76
- infom 'Writing no SSL site conf...'
77
- no_ssl_site.write(no_ssl_site_content)
78
- end
79
-
80
- class EntriesReader
81
- common_constructor :job, :instance
82
-
83
- def read_entry(path, options = {})
84
- entry_from_job(path) || instance.read_entry(path, options)
85
- end
86
-
87
- private
88
-
89
- def entry_from_job(path)
90
- method = path.gsub('.', '_').underscore
91
- return job.send(method) if job.respond_to?(method, true)
92
- end
93
- end
94
- end
95
- end
96
- end
97
- end
@@ -1,104 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'active_support/callbacks'
4
- require 'delegate'
5
- require 'eac_ruby_utils/core_ext'
6
- require 'eac_launcher/git/base'
7
- require 'avm/git'
8
- require 'avm/patches/object/template'
9
- require 'net/http'
10
-
11
- module Avm
12
- module Stereotypes
13
- module EacWebappBase0
14
- class Deploy
15
- require_sub __FILE__, include_modules: true
16
- include ::ActiveSupport::Callbacks
17
-
18
- DEFAULT_REFERENCE = 'HEAD'
19
-
20
- enable_console_speaker
21
- enable_simple_cache
22
-
23
- JOBS = %w[git_deploy setup_files_units assert_instance_branch request_test].freeze
24
- define_callbacks(*JOBS)
25
-
26
- attr_reader :instance, :options
27
-
28
- def initialize(instance, options = {})
29
- @instance = instance
30
- @options = options
31
- end
32
-
33
- def build_git_commit
34
- ::Avm::Git::Commit.new(git, commit_sha1).deploy_to_env_path(
35
- instance.host_env,
36
- instance.read_entry(:fs_path)
37
- ).variables_source_set(instance)
38
- end
39
-
40
- def run
41
- start_banner
42
- JOBS.each do |job|
43
- run_callbacks job do
44
- send(job)
45
- end
46
- end
47
- ::Avm::Result.success('Deployed')
48
- rescue ::Avm::Result::Error => e
49
- e.to_result
50
- end
51
-
52
- def start_banner
53
- infov 'Instance', instance
54
- infov 'Git reference (User)', git_reference.if_present('- BLANK -')
55
- infov 'Git remote name', git_remote_name
56
- infov 'Git reference (Found)', git_reference_found
57
- infov 'Git commit SHA1', commit_sha1
58
- infov 'Appended directories', appended_directories
59
- end
60
-
61
- def git_deploy
62
- infom 'Deploying source code and appended content...'
63
- build_git_commit
64
- .append_directory(template.path)
65
- .append_directories(appended_directories)
66
- .append_file_content(VERSION_TARGET_PATH, version)
67
- .run
68
- end
69
-
70
- def setup_files_units
71
- instance.class.const_get('FILES_UNITS').each do |data_key, fs_path_subpath|
72
- FileUnit.new(self, data_key, fs_path_subpath).run
73
- end
74
- end
75
-
76
- def assert_instance_branch
77
- infom 'Setting instance branch...'
78
- git.execute!('push', git_remote_name, "#{commit_sha1}:refs/heads/#{instance.id}", '-f')
79
- end
80
-
81
- def request_test
82
- infom 'Requesting web interface...'
83
- uri = URI(instance.read_entry('web.url'))
84
- response = ::Net::HTTP.get_response(uri)
85
- infov 'Response status', response.code
86
- fatal_error "Request to #{uri} failed" unless response.code.to_i == 200
87
- end
88
-
89
- def git_uncached
90
- ::EacLauncher::Git::Base.new(git_repository_path)
91
- end
92
-
93
- def git_fetch_uncached
94
- infom "Fetching remote \"#{git_remote_name}\" from \"#{git_repository_path}\"..."
95
- git.fetch(git_remote_name)
96
- end
97
-
98
- def git_repository_path
99
- instance.source_instance.read_entry(:fs_path)
100
- end
101
- end
102
- end
103
- end
104
- end