avm-tools 0.68.0 → 0.69.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/eac_rails_base0/apache_host.rb +17 -0
- data/lib/avm/eac_rails_base0/deploy.rb +50 -0
- data/lib/avm/eac_rails_base0/instance.rb +14 -0
- data/lib/avm/eac_redmine_base0/deploy.rb +2 -2
- data/lib/avm/eac_redmine_base0/instance.rb +2 -2
- data/lib/avm/eac_webapp_base0/apache_host.rb +103 -0
- data/lib/avm/eac_webapp_base0/deploy.rb +102 -0
- data/lib/avm/eac_webapp_base0/deploy/appended_directories.rb +25 -0
- data/lib/avm/eac_webapp_base0/deploy/file_unit.rb +41 -0
- data/lib/avm/eac_webapp_base0/deploy/git_info.rb +49 -0
- data/lib/avm/eac_webapp_base0/deploy/version.rb +20 -0
- data/lib/avm/eac_webapp_base0/instance.rb +50 -0
- data/lib/avm/eac_webapp_base0/runner/apache_host.rb +39 -0
- data/lib/avm/eac_webapp_base0/runner/data.rb +25 -0
- data/lib/avm/eac_webapp_base0/runner/data/dump.rb +69 -0
- data/lib/avm/eac_webapp_base0/runner/data/load.rb +66 -0
- data/lib/avm/eac_webapp_base0/runner/deploy.rb +59 -0
- data/lib/avm/stereotypes/eac_wordpress_base0/apache_host.rb +2 -2
- data/lib/avm/stereotypes/eac_wordpress_base0/deploy.rb +2 -2
- data/lib/avm/stereotypes/eac_wordpress_base0/instance.rb +2 -2
- data/lib/avm/tools/runner/eac_rails_base0.rb +2 -2
- data/lib/avm/tools/runner/eac_rails_base0/apache_host.rb +3 -26
- data/lib/avm/tools/runner/eac_rails_base0/data.rb +2 -2
- data/lib/avm/tools/runner/eac_rails_base0/deploy.rb +3 -3
- data/lib/avm/tools/runner/eac_redmine_base0/data.rb +1 -1
- data/lib/avm/tools/runner/eac_redmine_base0/data/dump.rb +2 -2
- data/lib/avm/tools/runner/eac_redmine_base0/deploy.rb +2 -2
- data/lib/avm/tools/runner/eac_redmine_base0/project_rename.rb +1 -0
- data/lib/avm/tools/runner/eac_wordpress_base0/apache_host.rb +3 -25
- data/lib/avm/tools/runner/eac_wordpress_base0/data.rb +2 -2
- data/lib/avm/tools/runner/eac_wordpress_base0/deploy.rb +2 -2
- data/lib/avm/tools/version.rb +1 -1
- data/template/avm/{stereotypes/eac_rails_base0 → eac_rails_base0}/deploy/config/database.yml.template +0 -0
- data/template/avm/{stereotypes/eac_webapp_base0 → eac_webapp_base0}/apache_host/no_ssl.conf +0 -0
- data/vendor/eac_cli/Gemfile +5 -0
- data/vendor/eac_cli/eac_cli.gemspec +18 -0
- data/vendor/eac_cli/lib/eac_cli.rb +7 -0
- data/vendor/eac_cli/lib/eac_cli/default_runner.rb +22 -0
- data/vendor/eac_cli/lib/eac_cli/definition.rb +72 -0
- data/vendor/eac_cli/lib/eac_cli/definition/argument_option.rb +13 -0
- data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +26 -0
- data/vendor/eac_cli/lib/eac_cli/definition/boolean_option.rb +13 -0
- data/vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb +27 -0
- data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +77 -0
- data/vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb +45 -0
- data/vendor/eac_cli/lib/eac_cli/parser.rb +14 -0
- data/vendor/eac_cli/lib/eac_cli/parser/collector.rb +56 -0
- data/vendor/eac_cli/lib/eac_cli/parser/error.rb +15 -0
- data/vendor/eac_cli/lib/eac_cli/parser/options_collection.rb +105 -0
- data/vendor/eac_cli/lib/eac_cli/parser/parse_result.rb +21 -0
- data/vendor/eac_cli/lib/eac_cli/parser/positional_collection.rb +49 -0
- data/vendor/eac_cli/lib/eac_cli/runner.rb +87 -0
- data/vendor/eac_cli/lib/eac_cli/runner/context.rb +18 -0
- data/vendor/eac_cli/lib/eac_cli/version.rb +5 -0
- data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +70 -0
- data/vendor/eac_cli/spec/rubocop_spec.rb +7 -0
- data/vendor/eac_cli/spec/spec_helper.rb +100 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/gem.rb +10 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple.rb +5 -34
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb +42 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/result.rb +25 -0
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/common_concern.rb +4 -4
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner.rb +6 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_class_methods.rb +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/console/docopt_runner/_subcommands.rb +8 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +18 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/value.rb +3 -2
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string.rb +4 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/inflector.rb +9 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/struct.rb +47 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/inflector_spec.rb +15 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/struct_spec.rb +46 -0
- metadata +50 -18
- data/lib/avm/stereotypes/eac_rails_base0/apache_host.rb +0 -19
- data/lib/avm/stereotypes/eac_rails_base0/deploy.rb +0 -52
- data/lib/avm/stereotypes/eac_rails_base0/instance.rb +0 -16
- data/lib/avm/stereotypes/eac_webapp_base0/apache_host.rb +0 -97
- data/lib/avm/stereotypes/eac_webapp_base0/deploy.rb +0 -104
- data/lib/avm/stereotypes/eac_webapp_base0/deploy/appended_directories.rb +0 -27
- data/lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb +0 -43
- data/lib/avm/stereotypes/eac_webapp_base0/deploy/git_info.rb +0 -51
- data/lib/avm/stereotypes/eac_webapp_base0/deploy/version.rb +0 -22
- data/lib/avm/stereotypes/eac_webapp_base0/instance.rb +0 -52
- data/lib/avm/stereotypes/eac_webapp_base0/runner/data.rb +0 -27
- data/lib/avm/stereotypes/eac_webapp_base0/runner/data/dump.rb +0 -71
- data/lib/avm/stereotypes/eac_webapp_base0/runner/data/load.rb +0 -68
- data/lib/avm/stereotypes/eac_webapp_base0/runner/deploy.rb +0 -61
@@ -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.
|
4
|
+
version: 0.69.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-09-
|
11
|
+
date: 2020-09-23 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
|
@@ -423,26 +438,12 @@ files:
|
|
423
438
|
- lib/avm/self/instance/entry_keys.rb
|
424
439
|
- lib/avm/stereotypes.rb
|
425
440
|
- lib/avm/stereotypes/eac_rails_base0.rb
|
426
|
-
- lib/avm/stereotypes/eac_rails_base0/apache_host.rb
|
427
|
-
- lib/avm/stereotypes/eac_rails_base0/deploy.rb
|
428
|
-
- lib/avm/stereotypes/eac_rails_base0/instance.rb
|
429
441
|
- lib/avm/stereotypes/eac_redmine_base0.rb
|
430
442
|
- lib/avm/stereotypes/eac_ubuntu_base0.rb
|
431
443
|
- lib/avm/stereotypes/eac_ubuntu_base0/apache.rb
|
432
444
|
- lib/avm/stereotypes/eac_ubuntu_base0/apache/site.rb
|
433
445
|
- lib/avm/stereotypes/eac_ubuntu_base0/docker_image.rb
|
434
446
|
- lib/avm/stereotypes/eac_webapp_base0.rb
|
435
|
-
- lib/avm/stereotypes/eac_webapp_base0/apache_host.rb
|
436
|
-
- lib/avm/stereotypes/eac_webapp_base0/deploy.rb
|
437
|
-
- lib/avm/stereotypes/eac_webapp_base0/deploy/appended_directories.rb
|
438
|
-
- lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
|
439
|
-
- lib/avm/stereotypes/eac_webapp_base0/deploy/git_info.rb
|
440
|
-
- lib/avm/stereotypes/eac_webapp_base0/deploy/version.rb
|
441
|
-
- lib/avm/stereotypes/eac_webapp_base0/instance.rb
|
442
|
-
- lib/avm/stereotypes/eac_webapp_base0/runner/data.rb
|
443
|
-
- lib/avm/stereotypes/eac_webapp_base0/runner/data/dump.rb
|
444
|
-
- lib/avm/stereotypes/eac_webapp_base0/runner/data/load.rb
|
445
|
-
- lib/avm/stereotypes/eac_webapp_base0/runner/deploy.rb
|
446
447
|
- lib/avm/stereotypes/eac_wordpress_base0/apache_host.rb
|
447
448
|
- lib/avm/stereotypes/eac_wordpress_base0/deploy.rb
|
448
449
|
- lib/avm/stereotypes/eac_wordpress_base0/instance.rb
|
@@ -542,8 +543,10 @@ files:
|
|
542
543
|
- lib/eac_launcher/vendor.rb
|
543
544
|
- lib/eac_launcher/vendor/github.rb
|
544
545
|
- lib/eac_launcher/version.rb
|
546
|
+
- template/avm/eac_rails_base0/deploy/config/database.yml.template
|
545
547
|
- template/avm/eac_redmine_base0/deploy/config/install.sh.template
|
546
548
|
- template/avm/eac_redmine_base0/deploy/config/secrets.yml
|
549
|
+
- template/avm/eac_webapp_base0/apache_host/no_ssl.conf
|
547
550
|
- template/avm/ruby/gems/generator/gemspec.template
|
548
551
|
- template/avm/ruby/gems/generator/root_lib.template
|
549
552
|
- template/avm/ruby/gems/generator/static/Gemfile
|
@@ -552,10 +555,31 @@ files:
|
|
552
555
|
- template/avm/ruby/gems/generator/version.template
|
553
556
|
- template/avm/self/docker_image/Dockerfile
|
554
557
|
- template/avm/self/docker_image/entrypoint.sh
|
555
|
-
- template/avm/stereotypes/eac_rails_base0/deploy/config/database.yml.template
|
556
558
|
- template/avm/stereotypes/eac_ubuntu_base0/docker_image/Dockerfile
|
557
|
-
- template/avm/stereotypes/eac_webapp_base0/apache_host/no_ssl.conf
|
558
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/default_runner.rb
|
564
|
+
- vendor/eac_cli/lib/eac_cli/definition.rb
|
565
|
+
- vendor/eac_cli/lib/eac_cli/definition/argument_option.rb
|
566
|
+
- vendor/eac_cli/lib/eac_cli/definition/base_option.rb
|
567
|
+
- vendor/eac_cli/lib/eac_cli/definition/boolean_option.rb
|
568
|
+
- vendor/eac_cli/lib/eac_cli/definition/positional_argument.rb
|
569
|
+
- vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb
|
570
|
+
- vendor/eac_cli/lib/eac_cli/docopt/runner_extension.rb
|
571
|
+
- vendor/eac_cli/lib/eac_cli/parser.rb
|
572
|
+
- vendor/eac_cli/lib/eac_cli/parser/collector.rb
|
573
|
+
- vendor/eac_cli/lib/eac_cli/parser/error.rb
|
574
|
+
- vendor/eac_cli/lib/eac_cli/parser/options_collection.rb
|
575
|
+
- vendor/eac_cli/lib/eac_cli/parser/parse_result.rb
|
576
|
+
- vendor/eac_cli/lib/eac_cli/parser/positional_collection.rb
|
577
|
+
- vendor/eac_cli/lib/eac_cli/runner.rb
|
578
|
+
- vendor/eac_cli/lib/eac_cli/runner/context.rb
|
579
|
+
- vendor/eac_cli/lib/eac_cli/version.rb
|
580
|
+
- vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb
|
581
|
+
- vendor/eac_cli/spec/rubocop_spec.rb
|
582
|
+
- vendor/eac_cli/spec/spec_helper.rb
|
559
583
|
- vendor/eac_docker/Gemfile
|
560
584
|
- vendor/eac_docker/eac_docker.gemspec
|
561
585
|
- vendor/eac_docker/lib/eac_docker.rb
|
@@ -797,6 +821,8 @@ files:
|
|
797
821
|
- vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/base.rb
|
798
822
|
- vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/minitest.rb
|
799
823
|
- vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple.rb
|
824
|
+
- vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/decorated_gem.rb
|
825
|
+
- vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/result.rb
|
800
826
|
- vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/rspec.rb
|
801
827
|
- vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb
|
802
828
|
- vendor/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem_spec.rb
|
@@ -867,6 +893,7 @@ files:
|
|
867
893
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/immutable/common_accessor.rb
|
868
894
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/immutable/hash_accessor.rb
|
869
895
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/immutable/instance_methods.rb
|
896
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb
|
870
897
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/listable.rb
|
871
898
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/class_methods.rb
|
872
899
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/instance_methods.rb
|
@@ -905,6 +932,8 @@ files:
|
|
905
932
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb
|
906
933
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp.rb
|
907
934
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp/if_match.rb
|
935
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string.rb
|
936
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/inflector.rb
|
908
937
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time.rb
|
909
938
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/default_time_zone_set.rb
|
910
939
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/local_time_zone.rb
|
@@ -918,6 +947,7 @@ files:
|
|
918
947
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/ruby/on_clean_environment.rb
|
919
948
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider.rb
|
920
949
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/simple_cache.rb
|
950
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/struct.rb
|
921
951
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/templates.rb
|
922
952
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/directory.rb
|
923
953
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/templates/file.rb
|
@@ -944,6 +974,7 @@ files:
|
|
944
974
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/extname_spec.rb
|
945
975
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp/temp_spec.rb
|
946
976
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp_spec.rb
|
977
|
+
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/inflector_spec.rb
|
947
978
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/listable_spec.rb
|
948
979
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/options_consumer_spec.rb
|
949
980
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerable/boolean_combinations_spec.rb
|
@@ -963,6 +994,7 @@ files:
|
|
963
994
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby_spec.rb
|
964
995
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb
|
965
996
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/simple_cache_spec.rb
|
997
|
+
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/struct_spec.rb
|
966
998
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/file_spec.rb
|
967
999
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/templates/file_spec_files/expected_content
|
968
1000
|
- 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
|