eac_tools 0.92.0 → 0.94.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +68 -53
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/avm.gemspec +3 -3
- data/sub/avm/lib/avm/launcher/context.rb +0 -5
- data/sub/avm/lib/avm/rspec/launcher_controller.rb +96 -0
- data/sub/avm/lib/avm/rspec/setup.rb +1 -1
- data/sub/avm/lib/avm/rspec/shared_examples/with_launcher.rb +16 -0
- data/sub/avm/lib/avm/scms/base.rb +1 -1
- data/sub/avm/lib/avm/sources/base/sub.rb +1 -1
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm/spec/lib/avm/launcher/context_spec.rb +2 -2
- data/sub/avm/spec/lib/avm/launcher/instances/base_spec.rb +2 -2
- data/sub/avm/template/avm/rspec/launcher_controller/settings.yml +1 -0
- data/sub/avm-eac_webapp_base0/Gemfile +8 -0
- data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +25 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/executables.rb +26 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/file_formats/css/file_apply.rb +48 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/file_formats/css.rb +22 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/file_formats/html.rb +43 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/file_formats/javascript.rb +22 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/file_formats/json.rb +25 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/file_formats/provider.rb +24 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/file_formats/xml.rb +26 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/file_formats.rb +11 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/apache_base.rb +33 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/apache_host.rb +78 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/apache_path.rb +42 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/apache.rb +44 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/deploy_info.rb +30 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base/install.rb +22 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb +44 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/appended_directories.rb +27 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/build.rb +50 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/info.rb +47 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/scm.rb +88 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/setup_files_unit.rb +53 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/write_on_target.rb +20 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy.rb +76 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy_info.rb +37 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/processes/web_server.rb +37 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/processes.rb +13 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/apache_host.rb +36 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/apache_path.rb +40 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data/load.rb +60 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/deploy.rb +57 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/deploy_info.rb +28 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners.rb +13 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/sources/base.rb +15 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/sources.rb +11 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +7 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0.rb +9 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/css_spec.rb +7 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/css_spec_files/css1.source.css +11 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/css_spec_files/css1.target.css +11 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/html_spec.rb +7 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/html_spec_files/html_code.html.erb.source +8 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/html_spec_files/html_code.html.erb.target +8 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/html_spec_files/html_code.html.source +5 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/html_spec_files/html_code.html.target +5 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/javascript_spec.rb +7 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/javascript_spec_files/javascript_code1.js.source +29 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/javascript_spec_files/javascript_code1.js.target +21 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/json_spec.rb +7 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/json_spec_files/json_code.json.source +8 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/json_spec_files/json_code.json.target +7 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/xml_spec.rb +7 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/xml_spec_files/xml_code.xml.source +11 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/file_formats/xml_spec_files/xml_code.xml.target +9 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/instances/base_spec.rb +11 -0
- data/sub/avm-eac_webapp_base0/spec/lib/avm/eac_webapp_base0/sources/base_spec.rb +7 -0
- data/sub/avm-eac_webapp_base0/spec/rubocop_spec.rb +3 -0
- data/sub/avm-eac_webapp_base0/spec/spec_helper.rb +4 -0
- data/sub/avm-eac_webapp_base0/template/avm/eac_webapp_base0/instances/apache_host/no_ssl.conf +11 -0
- data/sub/avm-eac_webapp_base0/template/avm/eac_webapp_base0/instances/apache_path/default.conf +7 -0
- data/sub/avm-git/Gemfile +8 -0
- data/sub/avm-git/avm-git.gemspec +25 -0
- data/sub/avm-git/lib/avm/git/application_scms/base/assert_main_at.rb +49 -0
- data/sub/avm-git/lib/avm/git/application_scms/base.rb +21 -0
- data/sub/avm-git/lib/avm/git/application_scms.rb +11 -0
- data/sub/avm-git/lib/avm/git/commit/class_methods.rb +31 -0
- data/sub/avm-git/lib/avm/git/commit/diff_tree_line.rb +32 -0
- data/sub/avm-git/lib/avm/git/commit/file.rb +46 -0
- data/sub/avm-git/lib/avm/git/commit.rb +59 -0
- data/sub/avm-git/lib/avm/git/issue/complete/commits.rb +42 -0
- data/sub/avm-git/lib/avm/git/issue/complete/git_subrepos.rb +23 -0
- data/sub/avm-git/lib/avm/git/issue/complete/local_branch.rb +61 -0
- data/sub/avm-git/lib/avm/git/issue/complete/local_tag.rb +39 -0
- data/sub/avm-git/lib/avm/git/issue/complete/push.rb +60 -0
- data/sub/avm-git/lib/avm/git/issue/complete/remote.rb +33 -0
- data/sub/avm-git/lib/avm/git/issue/complete/test.rb +40 -0
- data/sub/avm-git/lib/avm/git/issue/complete/tracker.rb +21 -0
- data/sub/avm-git/lib/avm/git/issue/complete/validation.rb +39 -0
- data/sub/avm-git/lib/avm/git/issue/complete/validations.rb +53 -0
- data/sub/avm-git/lib/avm/git/issue/complete/working_tree.rb +19 -0
- data/sub/avm-git/lib/avm/git/issue/complete.rb +69 -0
- data/sub/avm-git/lib/avm/git/issue.rb +11 -0
- data/sub/avm-git/lib/avm/git/launcher/base/class_methods.rb +28 -0
- data/sub/avm-git/lib/avm/git/launcher/base/dirty_files.rb +23 -0
- data/sub/avm-git/lib/avm/git/launcher/base/remotes.rb +40 -0
- data/sub/avm-git/lib/avm/git/launcher/base/subrepo.rb +44 -0
- data/sub/avm-git/lib/avm/git/launcher/base/underlying.rb +59 -0
- data/sub/avm-git/lib/avm/git/launcher/base.rb +87 -0
- data/sub/avm-git/lib/avm/git/launcher/error.rb +15 -0
- data/sub/avm-git/lib/avm/git/launcher/mirror_update.rb +38 -0
- data/sub/avm-git/lib/avm/git/launcher/publish_base.rb +131 -0
- data/sub/avm-git/lib/avm/git/launcher/remote.rb +55 -0
- data/sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb +33 -0
- data/sub/avm-git/lib/avm/git/launcher/warp_base.rb +68 -0
- data/sub/avm-git/lib/avm/git/launcher.rb +7 -0
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git/local_project_mixin.rb +19 -0
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git/publish.rb +15 -0
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git/warp.rb +27 -0
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git.rb +25 -0
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subrepo/publish.rb +31 -0
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subrepo/warp.rb +88 -0
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subrepo.rb +36 -0
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subtree/publish.rb +14 -0
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subtree/warp.rb +32 -0
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subtree.rb +51 -0
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/provider.rb +22 -0
- data/sub/avm-git/lib/avm/git/launcher_stereotypes.rb +11 -0
- data/sub/avm-git/lib/avm/git/organize/reference_update.rb +34 -0
- data/sub/avm-git/lib/avm/git/organize/repository.rb +77 -0
- data/sub/avm-git/lib/avm/git/organize.rb +11 -0
- data/sub/avm-git/lib/avm/git/revision_test.rb +105 -0
- data/sub/avm-git/lib/avm/git/runners/base/commit.rb +102 -0
- data/sub/avm-git/lib/avm/git/runners/base/deploy.rb +111 -0
- data/sub/avm-git/lib/avm/git/runners/base/dirty_files.rb +44 -0
- data/sub/avm-git/lib/avm/git/runners/base/organize.rb +75 -0
- data/sub/avm-git/lib/avm/git/runners/base/revisions_test.rb +66 -0
- data/sub/avm-git/lib/avm/git/runners/base/subrepo/check.rb +48 -0
- data/sub/avm-git/lib/avm/git/runners/base/subrepo/clone.rb +83 -0
- data/sub/avm-git/lib/avm/git/runners/base/subrepo/fix.rb +76 -0
- data/sub/avm-git/lib/avm/git/runners/base/subrepo.rb +19 -0
- data/sub/avm-git/lib/avm/git/runners/base.rb +43 -0
- data/sub/avm-git/lib/avm/git/runners.rb +11 -0
- data/sub/avm-git/lib/avm/git/scms/git/branch.rb +31 -0
- data/sub/avm-git/lib/avm/git/scms/git/branches.rb +20 -0
- data/sub/avm-git/lib/avm/git/scms/git/change_tracker.rb +36 -0
- data/sub/avm-git/lib/avm/git/scms/git/changed_file.rb +16 -0
- data/sub/avm-git/lib/avm/git/scms/git/changed_files.rb +24 -0
- data/sub/avm-git/lib/avm/git/scms/git/commit/deploy.rb +43 -0
- data/sub/avm-git/lib/avm/git/scms/git/commit/deploy_methods.rb +30 -0
- data/sub/avm-git/lib/avm/git/scms/git/commit.rb +67 -0
- data/sub/avm-git/lib/avm/git/scms/git/commit_dirty.rb +36 -0
- data/sub/avm-git/lib/avm/git/scms/git/commits.rb +47 -0
- data/sub/avm-git/lib/avm/git/scms/git/interval.rb +31 -0
- data/sub/avm-git/lib/avm/git/scms/git/milestones.rb +21 -0
- data/sub/avm-git/lib/avm/git/scms/git/remote.rb +21 -0
- data/sub/avm-git/lib/avm/git/scms/git/remotes.rb +32 -0
- data/sub/avm-git/lib/avm/git/scms/git/run_commit.rb +57 -0
- data/sub/avm-git/lib/avm/git/scms/git.rb +51 -0
- data/sub/avm-git/lib/avm/git/scms/git_sub_base/changed_file.rb +21 -0
- data/sub/avm-git/lib/avm/git/scms/git_sub_base/commit.rb +27 -0
- data/sub/avm-git/lib/avm/git/scms/git_sub_base/interval.rb +28 -0
- data/sub/avm-git/lib/avm/git/scms/git_sub_base.rb +33 -0
- data/sub/avm-git/lib/avm/git/scms/git_subrepo.rb +37 -0
- data/sub/avm-git/lib/avm/git/scms/git_subtree.rb +34 -0
- data/sub/avm-git/lib/avm/git/scms/provider.rb +21 -0
- data/sub/avm-git/lib/avm/git/scms.rb +11 -0
- data/sub/avm-git/lib/avm/git/subrepo_check/parent.rb +51 -0
- data/sub/avm-git/lib/avm/git/subrepo_check/remote.rb +89 -0
- data/sub/avm-git/lib/avm/git/subrepo_check/show_result.rb +32 -0
- data/sub/avm-git/lib/avm/git/subrepo_check.rb +38 -0
- data/sub/avm-git/lib/avm/git/subrepo_checks.rb +60 -0
- data/sub/avm-git/lib/avm/git/vendor/github.rb +20 -0
- data/sub/avm-git/lib/avm/git/vendor.rb +11 -0
- data/sub/avm-git/lib/avm/git/version.rb +7 -0
- data/sub/avm-git/lib/avm/git.rb +9 -0
- data/sub/avm-git/locale/en.yml +6 -0
- data/sub/avm-git/locale/pt-BR.yml +6 -0
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec.rb +13 -0
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/add.source.out +1 -0
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/add.target.yaml +7 -0
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/modify.source.out +1 -0
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/modify.target.yaml +7 -0
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/remove.source.out +1 -0
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/remove.target.yaml +7 -0
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename.source.out +2 -0
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename.target.yaml +13 -0
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename_modify.source.out +2 -0
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename_modify.target.yaml +13 -0
- data/sub/avm-git/spec/lib/avm/git/commit_spec.rb +56 -0
- data/sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb +45 -0
- data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/publish_spec.rb +83 -0
- data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/publish_spec_files/config.yml +5 -0
- data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/publish_spec_settings.yml +6 -0
- data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec.rb +53 -0
- data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec_files/config.yml +3 -0
- data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec_settings.yml +6 -0
- data/sub/avm-git/spec/lib/avm/git/runners/base/deploy_spec.rb +126 -0
- data/sub/avm-git/spec/lib/avm/git/runners/base/deploy_spec_files/append1/stub3.txt.template +1 -0
- data/sub/avm-git/spec/lib/avm/git/runners/base/deploy_spec_files/append2/stub4.txt +1 -0
- data/sub/avm-git/spec/lib/avm/git/scms/git/commit/deploy_spec.rb +92 -0
- data/sub/avm-git/spec/lib/avm/git/scms/git_spec.rb +8 -0
- data/sub/avm-git/spec/lib/avm/git/scms/git_subrepo_spec.rb +8 -0
- data/sub/avm-git/spec/lib/avm/git/vendor/github_spec.rb +23 -0
- data/sub/avm-git/spec/rubocop_spec.rb +3 -0
- data/sub/avm-git/spec/spec_helper.rb +4 -0
- data/sub/avm-tools/Gemfile +8 -0
- data/sub/avm-tools/README.textile +28 -0
- data/sub/avm-tools/avm-tools.gemspec +25 -0
- data/sub/avm-tools/exe/avm +6 -0
- data/sub/avm-tools/lib/avm/tools/core_ext.rb +3 -0
- data/sub/avm-tools/lib/avm/tools/rspec/helpers/runner.rb +20 -0
- data/sub/avm-tools/lib/avm/tools/rspec/helpers.rb +13 -0
- data/sub/avm-tools/lib/avm/tools/rspec/setup.rb +24 -0
- data/sub/avm-tools/lib/avm/tools/rspec.rb +11 -0
- data/sub/avm-tools/lib/avm/tools/runner/application/info.rb +36 -0
- data/sub/avm-tools/lib/avm/tools/runner/application.rb +26 -0
- data/sub/avm-tools/lib/avm/tools/runner/application_stereotypes/list.rb +31 -0
- data/sub/avm-tools/lib/avm/tools/runner/application_stereotypes.rb +16 -0
- data/sub/avm-tools/lib/avm/tools/runner/applications/list.rb +31 -0
- data/sub/avm-tools/lib/avm/tools/runner/applications.rb +16 -0
- data/sub/avm-tools/lib/avm/tools/runner/config/load_path.rb +52 -0
- data/sub/avm-tools/lib/avm/tools/runner/config.rb +17 -0
- data/sub/avm-tools/lib/avm/tools/runner/files/format.rb +50 -0
- data/sub/avm-tools/lib/avm/tools/runner/files/rotate.rb +31 -0
- data/sub/avm-tools/lib/avm/tools/runner/files.rb +17 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/data/clear.rb +18 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/data/dump.rb +20 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/data/load.rb +25 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/data/unit/clear.rb +20 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/data/unit/dump.rb +20 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/data/unit/load.rb +25 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/data/unit.rb +44 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/data.rb +27 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/entry.rb +43 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/info.rb +39 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance/system.rb +65 -0
- data/sub/avm-tools/lib/avm/tools/runner/instance.rb +16 -0
- data/sub/avm-tools/lib/avm/tools/runner/launcher/instances.rb +36 -0
- data/sub/avm-tools/lib/avm/tools/runner/launcher/projects.rb +40 -0
- data/sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb +53 -0
- data/sub/avm-tools/lib/avm/tools/runner/launcher.rb +17 -0
- data/sub/avm-tools/lib/avm/tools/runner/launcher_stereotypes/list.rb +41 -0
- data/sub/avm-tools/lib/avm/tools/runner/launcher_stereotypes.rb +16 -0
- data/sub/avm-tools/lib/avm/tools/runner/self/docker.rb +14 -0
- data/sub/avm-tools/lib/avm/tools/runner/self/registry.rb +25 -0
- data/sub/avm-tools/lib/avm/tools/runner/self.rb +22 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/auto_commit.rb +72 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/info.rb +55 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/issue/complete.rb +86 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/issue/deliver.rb +35 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/issue.rb +19 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/sub/remove.rb +22 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/sub.rb +29 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/subs.rb +72 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/test.rb +93 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/update.rb +22 -0
- data/sub/avm-tools/lib/avm/tools/runner/source/version_bump.rb +81 -0
- data/sub/avm-tools/lib/avm/tools/runner/source.rb +18 -0
- data/sub/avm-tools/lib/avm/tools/runner/source_generate.rb +12 -0
- data/sub/avm-tools/lib/avm/tools/runner.rb +27 -0
- data/sub/avm-tools/lib/avm/tools/runner_with/include_exclude.rb +23 -0
- data/sub/avm-tools/lib/avm/tools/runner_with/instance_data_clear.rb +23 -0
- data/sub/avm-tools/lib/avm/tools/runner_with/instance_data_dump.rb +59 -0
- data/sub/avm-tools/lib/avm/tools/runner_with/instance_data_load.rb +69 -0
- data/sub/avm-tools/lib/avm/tools/runner_with/instance_data_performer.rb +40 -0
- data/sub/avm-tools/lib/avm/tools/runner_with.rb +11 -0
- data/sub/avm-tools/lib/avm/tools/self.rb +23 -0
- data/sub/avm-tools/lib/avm/tools/version.rb +7 -0
- data/sub/avm-tools/lib/avm/tools.rb +9 -0
- data/sub/avm-tools/lib/avm.rb +7 -0
- data/sub/avm-tools/spec/lib/avm/tools/runner/files/rotate_spec.rb +72 -0
- data/sub/avm-tools/spec/lib/avm/tools/runner/launcher_stereotypes/list_spec.rb +17 -0
- data/sub/avm-tools/spec/lib/avm/tools/runner/source/issue/complete_spec.rb +49 -0
- data/sub/avm-tools/spec/lib/avm/tools/runner_spec.rb +15 -0
- data/sub/avm-tools/spec/rubocop_spec.rb +3 -0
- data/sub/avm-tools/spec/spec_helper.rb +4 -0
- metadata +284 -25
- data/sub/avm/spec/spec_helper/launcher_context.rb +0 -75
- /data/sub/avm/{spec → template/avm/rspec/launcher_controller}/dummy/avm-tools_stub/avm-tools.gemspec +0 -0
- /data/sub/avm/{spec → template/avm/rspec/launcher_controller}/dummy/avm-tools_stub/lib/avm/tools/version.rb +0 -0
- /data/sub/avm/{spec → template/avm/rspec/launcher_controller}/dummy/avm-tools_stub/lib/avm/tools.rb +0 -0
- /data/sub/avm/{spec → template/avm/rspec/launcher_controller}/dummy/ruby_gem_stub/lib/ruby_gem_stub/version.rb +0 -0
- /data/sub/avm/{spec → template/avm/rspec/launcher_controller}/dummy/ruby_gem_stub/lib/ruby_gem_stub.rb +0 -0
- /data/sub/avm/{spec → template/avm/rspec/launcher_controller}/dummy/ruby_gem_stub/ruby_gem_stub.gemspec +0 -0
@@ -0,0 +1,13 @@
|
|
1
|
+
---
|
2
|
+
- src_mode: '100644'
|
3
|
+
dst_mode: '000000'
|
4
|
+
src_sha1: 4a30dfae816b984f05cfb594e0d5958bb8c387ae
|
5
|
+
dst_sha1: '0000000000000000000000000000000000000000'
|
6
|
+
status: D
|
7
|
+
path: nomes2.txt
|
8
|
+
- src_mode: '000000'
|
9
|
+
dst_mode: '100644'
|
10
|
+
src_sha1: '0000000000000000000000000000000000000000'
|
11
|
+
dst_sha1: 10728718a2915256ab162f1e05178ebff9efa6ce
|
12
|
+
status: A
|
13
|
+
path: nomes3.txt
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/git/commit'
|
4
|
+
|
5
|
+
RSpec.describe Avm::Git::Commit, :git do
|
6
|
+
let(:git) { stubbed_git_local_repo }
|
7
|
+
|
8
|
+
let(:first_commit_sha1) do
|
9
|
+
git.file('a.txt').write('AAA')
|
10
|
+
git.file('b.txt').write('BBB')
|
11
|
+
git.command('add', '.').execute!
|
12
|
+
git.command('commit', '-m', 'First commit.').execute!
|
13
|
+
git.rev_parse('HEAD')
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:second_commit_sha1) do
|
17
|
+
first_commit_sha1
|
18
|
+
git.file('a.txt').write('AAAAA')
|
19
|
+
git.file('b.txt').delete
|
20
|
+
git.file('ç.txt').write('CCC')
|
21
|
+
git.command('add', '.').execute!
|
22
|
+
git.command('commit', '-m', 'Second commit.').execute!
|
23
|
+
git.rev_parse('HEAD')
|
24
|
+
end
|
25
|
+
|
26
|
+
let(:first_commit) { described_class.new(git, first_commit_sha1) }
|
27
|
+
let(:second_commit) { described_class.new(git, second_commit_sha1) }
|
28
|
+
|
29
|
+
describe '#files' do
|
30
|
+
it { expect(first_commit.files.count).to eq(2) }
|
31
|
+
it { expect(second_commit.files.count).to eq(3) }
|
32
|
+
|
33
|
+
{
|
34
|
+
'first_commit' => %w[a.txt b.txt],
|
35
|
+
'second_commit' => %w[a.txt b.txt ç.txt]
|
36
|
+
}.each do |commit_name, filenames|
|
37
|
+
filenames.each do |filename|
|
38
|
+
it "find file \"#{filename}\" in commit \"#{commit_name}\"" do
|
39
|
+
commit = send(commit_name)
|
40
|
+
file = commit.files.find { |f| f.path == filename }
|
41
|
+
expect(file).to be_a(Avm::Git::Commit::File)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe '#files_size' do
|
48
|
+
it { expect(first_commit.files_size).to eq(6) }
|
49
|
+
it { expect(second_commit.files_size).to eq(8) }
|
50
|
+
end
|
51
|
+
|
52
|
+
describe '#root_child?' do
|
53
|
+
it { expect(first_commit.root_child?).to be(true) }
|
54
|
+
it { expect(second_commit.root_child?).to be(false) }
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/git/launcher/base'
|
4
|
+
|
5
|
+
RSpec.describe Avm::Git::Launcher::Base do
|
6
|
+
context 'new non-bare repository' do # rubocop:disable RSpec/ContextWording
|
7
|
+
let(:repo) do
|
8
|
+
r = described_class.new(Dir.mktmpdir)
|
9
|
+
r.git
|
10
|
+
r
|
11
|
+
end
|
12
|
+
|
13
|
+
describe '#remote_exist?' do
|
14
|
+
it { expect(repo.remote_exist?('origin')).to be(false) }
|
15
|
+
|
16
|
+
context 'after remote added' do # rubocop:disable RSpec/ContextWording, :
|
17
|
+
before { repo.execute!('remote', 'add', 'origin', 'file:///path/to/remote') }
|
18
|
+
|
19
|
+
it { expect(repo.remote_exist?('origin')).to be(true) }
|
20
|
+
|
21
|
+
context 'after remote removed' do # rubocop:disable RSpec/ContextWording, :
|
22
|
+
before { repo.execute!('remote', 'remove', 'origin') }
|
23
|
+
|
24
|
+
it { expect(repo.remote_exist?('origin')).to be(false) }
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe '#assert_remote_url' do
|
30
|
+
it { expect(repo.remote_exist?('origin')).to be(false) }
|
31
|
+
|
32
|
+
context 'after asserted remote URL "/remote1"' do # rubocop:disable RSpec/ContextWording, :
|
33
|
+
before { repo.assert_remote_url('origin', '/remote1') }
|
34
|
+
|
35
|
+
it { expect(repo.git.remote('origin').url).to eq('/remote1') }
|
36
|
+
|
37
|
+
context 'after asserted remote URL "/remote2"' do # rubocop:disable RSpec/ContextWording, :
|
38
|
+
before { repo.assert_remote_url('origin', '/remote2') }
|
39
|
+
|
40
|
+
it { expect(repo.git.remote('origin').url).to eq('/remote2') }
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/git/launcher_stereotypes/git_subrepo/publish'
|
4
|
+
require 'avm/launcher/publish/check_result'
|
5
|
+
|
6
|
+
RSpec.describe Avm::Git::LauncherStereotypes::GitSubrepo::Publish do
|
7
|
+
include_context 'with_launcher'
|
8
|
+
include_examples 'with_config', __FILE__
|
9
|
+
|
10
|
+
describe '#check' do
|
11
|
+
context 'with clean context' do
|
12
|
+
let(:settings_path) { File.join(__dir__, 'publish_spec_settings.yml') }
|
13
|
+
|
14
|
+
before do
|
15
|
+
temp_context(settings_path)
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'with app with subrepo' do
|
19
|
+
let(:remote_repos) { init_remote('mylib') }
|
20
|
+
|
21
|
+
before do
|
22
|
+
wc = init_git('mylib')
|
23
|
+
touch_commit(wc, 'file1')
|
24
|
+
wc.execute!('remote', 'add', 'publish', remote_repos)
|
25
|
+
wc.execute!('push', 'publish', 'master')
|
26
|
+
end
|
27
|
+
|
28
|
+
let!(:app) do # rubocop:disable RSpec/ScatteredLet
|
29
|
+
r = init_git('app')
|
30
|
+
touch_commit(r, 'file2')
|
31
|
+
r.execute!('subrepo', 'clone', remote_repos, 'mylib')
|
32
|
+
launcher_controller.application_source_path('app', r.root_path)
|
33
|
+
r
|
34
|
+
end
|
35
|
+
|
36
|
+
it { check_publish_status(:updated) } # rubocop:disable RSpec/NoExpectationExample
|
37
|
+
|
38
|
+
context 'after subrepo updated and before publishing' do # rubocop:disable RSpec/ContextWording
|
39
|
+
before do
|
40
|
+
Avm::Launcher::Context.current.publish_options[:confirm] = true
|
41
|
+
touch_commit(app, 'mylib/file3')
|
42
|
+
end
|
43
|
+
|
44
|
+
it { expect(Avm::Launcher::Context.current.publish_options[:confirm]).to be(true) }
|
45
|
+
it { check_publish_status(:pending) } # rubocop:disable RSpec/NoExpectationExample
|
46
|
+
|
47
|
+
context 'after publishing' do # rubocop:disable RSpec/ContextWording
|
48
|
+
before { described_class.new(app_mylib_instance).run }
|
49
|
+
|
50
|
+
it { check_publish_status(:updated) } # rubocop:disable RSpec/NoExpectationExample
|
51
|
+
|
52
|
+
context 'after reset context' do # rubocop:disable RSpec/ContextWording
|
53
|
+
before do
|
54
|
+
sleep 2
|
55
|
+
launcher_controller.temp_context(settings_path)
|
56
|
+
end
|
57
|
+
|
58
|
+
it { check_publish_status(:updated) } # rubocop:disable RSpec/NoExpectationExample
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def check_publish_status(status_key) # rubocop:disable Metrics/AbcSize
|
64
|
+
instance = app_mylib_instance
|
65
|
+
expect(instance).to be_a(Avm::Launcher::Instances::Base)
|
66
|
+
expect(instance.stereotypes).to include(Avm::Git::LauncherStereotypes::GitSubrepo)
|
67
|
+
|
68
|
+
status = Avm::Launcher::Publish::CheckResult.const_get("STATUS_#{status_key}".upcase)
|
69
|
+
publish = described_class.new(instance)
|
70
|
+
expect(publish.check.status).to(
|
71
|
+
eq(status),
|
72
|
+
"Expected: #{status}, Actual: " \
|
73
|
+
"#{publish.check.status}, Message: #{publish.check.message}"
|
74
|
+
)
|
75
|
+
end
|
76
|
+
|
77
|
+
def app_mylib_instance
|
78
|
+
Avm::Launcher::Context.current.instance('/app/mylib')
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/git/launcher_stereotypes/git_subrepo/warp'
|
4
|
+
|
5
|
+
RSpec.describe Avm::Git::LauncherStereotypes::GitSubrepo::Warp do
|
6
|
+
include_context 'with_config', __FILE__
|
7
|
+
include_context 'with_launcher'
|
8
|
+
|
9
|
+
let(:repos) { init_remote('mylib_repos') }
|
10
|
+
let(:app1) { init_git('app1') } # rubocop:disable RSpec/IndexedLet
|
11
|
+
let(:app2) { init_git('app2') } # rubocop:disable RSpec/IndexedLet
|
12
|
+
|
13
|
+
describe '#unknown' do
|
14
|
+
before do
|
15
|
+
temp_context(File.join(__dir__, 'warp_spec_settings.yml'))
|
16
|
+
|
17
|
+
wc = init_git('mylib_wc')
|
18
|
+
touch_commit(wc, 'file1')
|
19
|
+
wc.execute!('remote', 'add', 'origin', repos)
|
20
|
+
wc.execute!('push', 'origin', 'master')
|
21
|
+
|
22
|
+
touch_commit(app1, 'file2')
|
23
|
+
app1.execute!('subrepo', 'clone', repos, 'mylib')
|
24
|
+
launcher_controller.application_source_path('app1', app1.root_path)
|
25
|
+
|
26
|
+
touch_commit(app2, 'file3')
|
27
|
+
app2.execute!('subrepo', 'clone', repos, 'mylib')
|
28
|
+
touch_commit(app2, 'mylib/file4')
|
29
|
+
app2.execute!('subrepo', 'push', 'mylib')
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'revisions should match' do # rubocop:disable RSpec/ExampleLength, RSpec/MultipleExpectations
|
33
|
+
master_ref = repos.rev_parse('master')
|
34
|
+
expect(master_ref.present?).to be true
|
35
|
+
|
36
|
+
master_ref_previous = repos.rev_parse('master^')
|
37
|
+
expect(master_ref_previous.present?).to be true
|
38
|
+
|
39
|
+
app2.execute!('subrepo', 'branch', 'mylib', '--fetch', '--force')
|
40
|
+
expect(app2.rev_parse('subrepo/mylib')).to eq master_ref
|
41
|
+
|
42
|
+
app1.execute!('subrepo', 'branch', 'mylib', '--fetch', '--force')
|
43
|
+
expect(app1.rev_parse('subrepo/mylib')).to eq master_ref_previous
|
44
|
+
|
45
|
+
instance = Avm::Launcher::Context.current.instance('/app1/mylib')
|
46
|
+
expect(instance).to be_a Avm::Launcher::Instances::Base
|
47
|
+
warp = instance.warped
|
48
|
+
expect(warp).to be_a described_class
|
49
|
+
wgit = Avm::Git::Launcher::Base.new(warp)
|
50
|
+
expect(wgit.rev_parse('HEAD')).to eq master_ref_previous
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,126 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_ubuntu_base0/rspec/ssh_docker_server'
|
4
|
+
require 'avm/git/runners/base'
|
5
|
+
require 'tmpdir'
|
6
|
+
|
7
|
+
RSpec.describe Avm::Git::Runners::Base::Deploy, :git do
|
8
|
+
let(:git) { stubbed_git_local_repo }
|
9
|
+
let(:reference) { git.current_branch }
|
10
|
+
let(:stub_file1) { 'stub1.txt' }
|
11
|
+
let(:stub_content1) { 'CONTENT 111' }
|
12
|
+
let(:stub_file2) { 'stub2.txt' }
|
13
|
+
let(:stub_content2) { 'CONTENT 222' }
|
14
|
+
let(:commit_sha1) do
|
15
|
+
git.file(stub_file1).write(stub_content1)
|
16
|
+
git.command('add', stub_file1).execute!
|
17
|
+
git.command('commit', '-m', 'First commit.').execute!
|
18
|
+
git.rev_parse('HEAD')
|
19
|
+
end
|
20
|
+
let(:append_dirs) do
|
21
|
+
[1, 2].map { |n| File.join(__dir__, 'deploy_spec_files', "append#{n}") }.join(':')
|
22
|
+
end
|
23
|
+
let(:target_dir) { File.join(Dir.mktmpdir, 'target') }
|
24
|
+
|
25
|
+
let(:commit_sha2) do
|
26
|
+
git.command('checkout', commit_sha1).execute!
|
27
|
+
git.file(stub_file1).delete
|
28
|
+
git.file(stub_file2).write(stub_content2)
|
29
|
+
git.command('add', stub_file1, stub_file2).execute!
|
30
|
+
git.command('commit', '-m', 'Second commit.').execute!
|
31
|
+
git.rev_parse('HEAD')
|
32
|
+
end
|
33
|
+
|
34
|
+
let(:target_stub_file1) { File.join(target_dir, stub_file1) }
|
35
|
+
let(:target_stub_file2) { File.join(target_dir, stub_file2) }
|
36
|
+
|
37
|
+
context 'with local target' do
|
38
|
+
before do
|
39
|
+
commit_sha1
|
40
|
+
avm_tools_runner_run(target_dir)
|
41
|
+
end
|
42
|
+
|
43
|
+
it { expect(File.read(target_stub_file1)).to eq(stub_content1) }
|
44
|
+
it { expect(File.exist?(target_stub_file2)).to be(false) }
|
45
|
+
|
46
|
+
context 'with second commit' do
|
47
|
+
before do
|
48
|
+
commit_sha2
|
49
|
+
avm_tools_runner_run(target_dir)
|
50
|
+
end
|
51
|
+
|
52
|
+
it { expect(File.exist?(target_stub_file1)).to be(false) }
|
53
|
+
it { expect(File.read(target_stub_file2)).to eq(stub_content2) }
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
context 'with append directories' do
|
58
|
+
let(:target_stub_file3) { File.join(target_dir, 'stub3.txt') }
|
59
|
+
let(:target_stub_file4) { File.join(target_dir, 'stub4.txt') }
|
60
|
+
|
61
|
+
before do
|
62
|
+
EacConfig::Node.context.current.entry('my_value').value = '123'
|
63
|
+
commit_sha1
|
64
|
+
avm_tools_runner_run('--append-dirs', append_dirs, target_dir)
|
65
|
+
end
|
66
|
+
|
67
|
+
it { expect(File.read(target_stub_file1)).to eq(stub_content1) }
|
68
|
+
it { expect(File.exist?(target_stub_file2)).to be(false) }
|
69
|
+
it { expect(File.read(target_stub_file3)).to eq("MyValue: 123\n") }
|
70
|
+
it { expect(File.read(target_stub_file4)).to eq("MyValue: %%MY_VALUE%%\n") }
|
71
|
+
end
|
72
|
+
|
73
|
+
context 'with instance' do
|
74
|
+
let(:target_stub_file3) { File.join(target_dir, 'stub3.txt') }
|
75
|
+
let(:target_stub_file4) { File.join(target_dir, 'stub4.txt') }
|
76
|
+
|
77
|
+
before do
|
78
|
+
EacConfig::Node.context.current.entry('my-instance_dev.my_value').value = '123'
|
79
|
+
commit_sha1
|
80
|
+
avm_tools_runner_run('-i', 'my-instance_dev', '--append-dirs', append_dirs, target_dir)
|
81
|
+
end
|
82
|
+
|
83
|
+
it { expect(File.read(target_stub_file1)).to eq(stub_content1) }
|
84
|
+
it { expect(File.exist?(target_stub_file2)).to be(false) }
|
85
|
+
it { expect(File.read(target_stub_file3)).to eq("MyValue: 123\n") }
|
86
|
+
it { expect(File.read(target_stub_file4)).to eq("MyValue: %%MY_VALUE%%\n") }
|
87
|
+
end
|
88
|
+
|
89
|
+
context 'with ssh target', :docker do
|
90
|
+
let(:ssh_server) { Avm::EacUbuntuBase0::Rspec::SshDockerServer.new }
|
91
|
+
let(:env) { ssh_server.env }
|
92
|
+
let(:tmpdir) { env.command('mktemp', '-d').execute! }
|
93
|
+
let(:target_dir) { File.join(tmpdir, 'target') }
|
94
|
+
let(:target_url) do
|
95
|
+
r = env.uri.dup
|
96
|
+
r.path = target_dir
|
97
|
+
r.to_s
|
98
|
+
end
|
99
|
+
|
100
|
+
around do |example|
|
101
|
+
ssh_server.on_run(&example)
|
102
|
+
end
|
103
|
+
|
104
|
+
before do
|
105
|
+
commit_sha1
|
106
|
+
avm_tools_runner_run(target_url)
|
107
|
+
end
|
108
|
+
|
109
|
+
it { expect(env.file(target_stub_file1).read).to eq(stub_content1) }
|
110
|
+
it { expect(env.file(target_stub_file2).exist?).to be(false) }
|
111
|
+
|
112
|
+
context 'with second commit' do
|
113
|
+
before do
|
114
|
+
commit_sha2
|
115
|
+
avm_tools_runner_run(target_url)
|
116
|
+
end
|
117
|
+
|
118
|
+
it { expect(env.file(target_stub_file1).exist?).to be(false) }
|
119
|
+
it { expect(env.file(target_stub_file2).read).to eq(stub_content2) }
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
def avm_tools_runner_args_prefix
|
124
|
+
['git', '-C', git.root_path.to_path, 'deploy']
|
125
|
+
end
|
126
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
MyValue: %%MY_VALUE%%
|
@@ -0,0 +1 @@
|
|
1
|
+
MyValue: %%MY_VALUE%%
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/git/scms/git'
|
4
|
+
require 'eac_ruby_utils/fs/temp'
|
5
|
+
|
6
|
+
RSpec.describe Avm::Git::Scms::Git::Commit::Deploy, :git do
|
7
|
+
class << self
|
8
|
+
FROM_DEPLOY = %w[a.txt b.txt c.txt appended].freeze # rubocop:disable RSpec/LeakyConstantDeclaration
|
9
|
+
NOT_FROM_DEPLOY = %w[to_be_removed].freeze # rubocop:disable RSpec/LeakyConstantDeclaration
|
10
|
+
|
11
|
+
def check_files(from_deploy_exist)
|
12
|
+
if from_deploy_exist
|
13
|
+
check_files_exist(FROM_DEPLOY)
|
14
|
+
check_files_not_exist(NOT_FROM_DEPLOY)
|
15
|
+
else
|
16
|
+
check_files_not_exist(FROM_DEPLOY)
|
17
|
+
check_files_exist(NOT_FROM_DEPLOY)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def check_file_exist(basename)
|
22
|
+
it("expect \"#{basename}\" to exist") { expect(target_dir.join(basename)).to exist }
|
23
|
+
end
|
24
|
+
|
25
|
+
def check_file_not_exist(basename)
|
26
|
+
it("expect \"#{basename}\" to not exist") { expect(target_dir.join(basename)).not_to exist }
|
27
|
+
end
|
28
|
+
|
29
|
+
def check_files_exist(basenames)
|
30
|
+
basenames.each { |basename| check_file_exist(basename) }
|
31
|
+
end
|
32
|
+
|
33
|
+
def check_files_not_exist(basenames)
|
34
|
+
basenames.each { |basename| check_file_not_exist(basename) }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
let(:git) { stubbed_git_local_repo }
|
39
|
+
|
40
|
+
let(:commit_sha1) do
|
41
|
+
git.file('a.txt').write('AAA')
|
42
|
+
git.file('b.txt').write('BBB')
|
43
|
+
git.command('add', '.').execute!
|
44
|
+
git.command('commit', '-m', 'First commit.').execute!
|
45
|
+
git.rev_parse('HEAD')
|
46
|
+
end
|
47
|
+
|
48
|
+
let(:appended_dir) do
|
49
|
+
r = EacRubyUtils::Fs::Temp.directory
|
50
|
+
r.join('appended.template').write('Needs a %%ABC%% value.')
|
51
|
+
r
|
52
|
+
end
|
53
|
+
|
54
|
+
let(:target_dir) do
|
55
|
+
r = EacRubyUtils::Fs::Temp.directory
|
56
|
+
FileUtils.touch(r.join('to_be_removed').to_path)
|
57
|
+
r
|
58
|
+
end
|
59
|
+
|
60
|
+
let(:commit) { Avm::Git::Scms::Git.new(git.root_path).commit(commit_sha1) }
|
61
|
+
let(:variables_source_class) do
|
62
|
+
Class.new do
|
63
|
+
attr_reader :abc
|
64
|
+
|
65
|
+
def initialize(abc)
|
66
|
+
@abc = abc
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
let(:variables_source) { variables_source_class.new('Any value') }
|
71
|
+
let(:target_env) { EacRubyUtils::Envs.local }
|
72
|
+
let(:instance) do
|
73
|
+
described_class.new(commit, target_env, target_dir).append_templatized_directory(appended_dir)
|
74
|
+
.append_file_content('c.txt', 'Any content')
|
75
|
+
.variables_source_set(variables_source)
|
76
|
+
end
|
77
|
+
|
78
|
+
after do
|
79
|
+
appended_dir.remove
|
80
|
+
target_dir.remove
|
81
|
+
end
|
82
|
+
|
83
|
+
context 'without run' do # rubocop:disable RSpec/EmptyExampleGroup
|
84
|
+
check_files(false)
|
85
|
+
end
|
86
|
+
|
87
|
+
context 'with run' do # rubocop:disable RSpec/EmptyExampleGroup
|
88
|
+
before { instance.run }
|
89
|
+
|
90
|
+
check_files(true)
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/git/vendor/github'
|
4
|
+
|
5
|
+
RSpec.describe Avm::Git::Vendor::Github do
|
6
|
+
describe '#to_ssh_url' do
|
7
|
+
SSH_URL = 'git@github.com:esquilo-azul/eac_launcher.git' # rubocop:disable RSpec/LeakyConstantDeclaration, Lint/ConstantDefinitionInBlock
|
8
|
+
NO_SSH_URL = 'https://otherhost.com/esquilo-azul/eac_launcher' # rubocop:disable RSpec/LeakyConstantDeclaration, Lint/ConstantDefinitionInBlock
|
9
|
+
|
10
|
+
{
|
11
|
+
nil => nil,
|
12
|
+
' ' => nil,
|
13
|
+
'https://github.com/esquilo-azul/eac_launcher' => SSH_URL,
|
14
|
+
'https://github.com/esquilo-azul/eac_launcher.git' => SSH_URL,
|
15
|
+
SSH_URL => SSH_URL,
|
16
|
+
NO_SSH_URL => NO_SSH_URL
|
17
|
+
}.each do |input, expected|
|
18
|
+
it "converts \"#{input}\" to \"#{expected}\"" do
|
19
|
+
expect(described_class.to_ssh_url(input)).to eq(expected)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
h1. AVM Tools
|
2
|
+
|
3
|
+
h2. Instance's entries suffixes
|
4
|
+
|
5
|
+
|_. Name |_. Description |_. Default value |
|
6
|
+
| admin.email | Admin's e-mail address | @host_id->admin.email@ |
|
7
|
+
| admin.name | Admin's name | @host_id->admin.name@ |
|
8
|
+
| access | *@local@* or *@ssh@* | @self->ssh.url ? 'ssh' : 'local'@ |
|
9
|
+
| data_fs_path | path to instance's data root directory | @host_id->data_fs_path + '/' + self->id@ |
|
10
|
+
| database.id | ID of instance to fetch database parameters | @nil@ |
|
11
|
+
| database.limit | Limit of open database connections | @database.id->database.limit or 5 |
|
12
|
+
| database.system | *@postgres@* or *@mysql@* or *@oracle@* | @nil@ |
|
13
|
+
| database.hostname | hostname of database server | @database.id->database.hostname or host_id->database.hostname or '127.0.0.1'@ |
|
14
|
+
| database.name | name of database | @database.id->database.name or self->id@ |
|
15
|
+
| database.password | password to login in database | @database.id->database.password or host_id->database.password@ |
|
16
|
+
| database.port | port of database server | @database.system->default_port@ |
|
17
|
+
| database.timeout | Database connection timeout (In miliseconds) | @database.id->database.timeout or 5000 |
|
18
|
+
| database.username | username to login in database | @database.id->database.username or host_id->database.username@ |
|
19
|
+
| fs_path | path to instance's installation | @host_id->fs_path + '/' + self->id@ |
|
20
|
+
| host_id | ID of instace to fetch host parameters | @nil@ |
|
21
|
+
| ssh.url | SSH URL to access instance's host | @host_id->ssh.url or self->ssh.username + '@' self->ssh.hostname@ |
|
22
|
+
| ssh.hostname | SSH hostname to access instance's host | @host_id->ssh.hostname@ |
|
23
|
+
| ssh.port | SSH port to access instance's host | '22' |
|
24
|
+
| ssh.username | SSH username to access instance's host | @host_id->ssh.username@ |
|
25
|
+
| system.group | Group of user that runs instance | @host_id->system.groupname or self->system.username@ |
|
26
|
+
| system.username | Name of user that runs instance | @host_id->system.username or self->ssh.username@ |
|
27
|
+
| web.url | Root URL to web interface | @nil@ |
|
28
|
+
| web.hostname | Hostname of web interface | @web.url->hostname@ |
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
4
|
+
|
5
|
+
require 'avm/tools/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = 'avm-tools'
|
9
|
+
s.version = Avm::Tools::VERSION
|
10
|
+
s.authors = ['Esquilo Azul Company']
|
11
|
+
s.summary = 'Tools for AVM.'
|
12
|
+
|
13
|
+
s.files = Dir['{exe,lib}/**/*', 'Gemfile']
|
14
|
+
s.bindir = 'exe'
|
15
|
+
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
16
|
+
|
17
|
+
s.required_ruby_version = '>= 2.7.0'
|
18
|
+
|
19
|
+
s.add_dependency 'avm', '~> 0.94'
|
20
|
+
s.add_dependency 'clipboard', '~> 1.4', '>= 1.4.1'
|
21
|
+
s.add_dependency 'eac_ruby_base0', '~> 0.19'
|
22
|
+
|
23
|
+
s.add_development_dependency 'avm-git', '~> 0.17'
|
24
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.8.1'
|
25
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Avm
|
4
|
+
module Tools
|
5
|
+
module Rspec
|
6
|
+
module Helpers
|
7
|
+
module Runner
|
8
|
+
def avm_tools_runner_args_prefix
|
9
|
+
[]
|
10
|
+
end
|
11
|
+
|
12
|
+
def avm_tools_runner_run(*argv)
|
13
|
+
require 'avm/tools/runner'
|
14
|
+
Avm::Tools::Runner.run(argv: avm_tools_runner_args_prefix + argv)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|