eac_tools 0.102.1 → 0.103.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +42 -34
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +26 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/apache_host.rb +12 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/database.rb +30 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/files.rb +22 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/gitolite.rb +55 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/install.rb +46 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/nodejs.rb +22 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base/web.rb +20 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb +59 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/deploy.rb +19 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb +116 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/entity_base.rb +35 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/project.rb +26 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/root.rb +21 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api/wiki_page.rb +54 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/rest_api.rb +14 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/docker.rb +17 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project/wiki_page/read.rb +27 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project/wiki_page/write.rb +70 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project/wiki_page.rb +30 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project.rb +26 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners/project_rename.rb +56 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/runners.rb +14 -0
- data/sub/{avm-git/lib/avm/git/runners.rb → avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances.rb} +4 -2
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/base.rb +36 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/core_update.rb +131 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners/core_update.rb +65 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners/docker.rb +19 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources/runners.rb +13 -0
- data/sub/{avm-git/lib/avm/git/organize.rb → avm-eac_redmine_base0/lib/avm/eac_redmine_base0/sources.rb} +4 -2
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +7 -0
- data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0.rb +16 -0
- data/sub/avm-eac_redmine_base0/locale/en.yml +6 -0
- data/sub/avm-eac_redmine_base0/locale/pt-BR.yml +6 -0
- data/sub/avm-eac_redmine_base0/spec/lib/avm/eac_redmine_base0/instances/apache_host_spec.rb +22 -0
- data/sub/avm-eac_redmine_base0/spec/lib/avm/eac_redmine_base0/instances/apache_host_spec_files/apache_host_spec_no_ssl_content.conf +11 -0
- data/sub/avm-eac_redmine_base0/spec/lib/avm/eac_redmine_base0/instances/base/gitolite_spec.rb +26 -0
- data/sub/avm-eac_redmine_base0/spec/lib/avm/eac_redmine_base0/instances/base/gitolite_spec_files/config.yml +10 -0
- data/sub/avm-eac_redmine_base0/spec/spec_helper.rb +6 -0
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/deploy/config/install.sh.template +45 -0
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/deploy/config/secrets.yml +8 -0
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/Dockerfile.template +36 -0
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_host_dockerfile +8 -0
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_http_virtualhost.conf.template +10 -0
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_https_virtualhost.conf.template +16 -0
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_path_dockerfile +5 -0
- data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/start.sh.template +52 -0
- data/sub/avm-eac_ubuntu_base0/Gemfile +8 -0
- data/sub/avm-eac_ubuntu_base0/avm-eac_ubuntu_base0.gemspec +21 -0
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/apache/resource.rb +57 -0
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/apache.rb +24 -0
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/docker_image.rb +31 -0
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/instances/base.rb +24 -0
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/rspec/ssh_docker_server.rb +82 -0
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/runners/base/docker.rb +15 -0
- data/sub/avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0/runners/base.rb +26 -0
- data/sub/{avm-git/lib/avm/git → avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0}/version.rb +2 -2
- data/sub/{avm-git/lib/avm/git.rb → avm-eac_ubuntu_base0/lib/avm/eac_ubuntu_base0.rb} +5 -8
- data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/docker_image_spec.rb +12 -0
- data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/rspec/ssh_docker_server_spec.rb +11 -0
- data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/runners/base/docker_spec.rb +11 -0
- data/sub/avm-eac_ubuntu_base0/spec/lib/avm/eac_ubuntu_base0/runners/base_spec.rb +5 -0
- data/sub/avm-eac_ubuntu_base0/spec/rubocop_spec.rb +3 -0
- data/sub/{avm-git → avm-eac_ubuntu_base0}/spec/spec_helper.rb +1 -1
- data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/docker_image/Dockerfile.template +27 -0
- data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/Dockerfile.template +24 -0
- data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/id_rsa +27 -0
- data/sub/avm-eac_ubuntu_base0/template/avm/eac_ubuntu_base0/rspec/ssh_docker_server/id_rsa.pub +1 -0
- data/sub/eac_docker/Gemfile +8 -0
- data/sub/eac_docker/eac_docker.gemspec +20 -0
- data/sub/eac_docker/lib/eac_docker/container.rb +83 -0
- data/sub/eac_docker/lib/eac_docker/debug.rb +13 -0
- data/sub/eac_docker/lib/eac_docker/executables.rb +15 -0
- data/sub/eac_docker/lib/eac_docker/images/base.rb +11 -0
- data/sub/eac_docker/lib/eac_docker/images/coded.rb +39 -0
- data/sub/eac_docker/lib/eac_docker/images/named.rb +26 -0
- data/sub/eac_docker/lib/eac_docker/images/templatized.rb +43 -0
- data/sub/eac_docker/lib/eac_docker/registry.rb +15 -0
- data/sub/eac_docker/lib/eac_docker/rspec/setup.rb +15 -0
- data/sub/eac_docker/lib/eac_docker/rspec/stub_image.rb +39 -0
- data/sub/eac_docker/lib/eac_docker/version.rb +5 -0
- data/sub/eac_docker/lib/eac_docker.rb +9 -0
- data/sub/eac_docker/spec/lib/eac_docker/executables_spec.rb +7 -0
- data/sub/eac_docker/spec/lib/eac_docker/images/coded_spec.rb +10 -0
- data/sub/eac_docker/spec/lib/eac_docker/images/coded_spec_files/image1/Dockerfile +1 -0
- data/sub/eac_docker/spec/lib/eac_docker/images/templatized_spec.rb +15 -0
- data/sub/eac_docker/spec/lib/eac_docker/images/templatized_spec_files/stub_docker_image/Dockerfile +1 -0
- data/sub/eac_docker/spec/rubocop_spec.rb +3 -0
- data/sub/eac_docker/spec/spec_helper.rb +5 -0
- metadata +101 -134
- data/sub/avm-git/avm-git.gemspec +0 -25
- data/sub/avm-git/lib/avm/git/application_scms/base/assert_main_at.rb +0 -44
- data/sub/avm-git/lib/avm/git/application_scms/base.rb +0 -18
- data/sub/avm-git/lib/avm/git/application_scms.rb +0 -9
- data/sub/avm-git/lib/avm/git/commit/class_methods.rb +0 -29
- data/sub/avm-git/lib/avm/git/commit/diff_tree_line.rb +0 -32
- data/sub/avm-git/lib/avm/git/commit/file.rb +0 -42
- data/sub/avm-git/lib/avm/git/commit.rb +0 -57
- data/sub/avm-git/lib/avm/git/issue/complete/commits.rb +0 -40
- data/sub/avm-git/lib/avm/git/issue/complete/git_subrepos.rb +0 -20
- data/sub/avm-git/lib/avm/git/issue/complete/local_branch.rb +0 -59
- data/sub/avm-git/lib/avm/git/issue/complete/local_tag.rb +0 -37
- data/sub/avm-git/lib/avm/git/issue/complete/push.rb +0 -60
- data/sub/avm-git/lib/avm/git/issue/complete/remote.rb +0 -33
- data/sub/avm-git/lib/avm/git/issue/complete/test.rb +0 -34
- data/sub/avm-git/lib/avm/git/issue/complete/tracker.rb +0 -21
- data/sub/avm-git/lib/avm/git/issue/complete/validation.rb +0 -36
- data/sub/avm-git/lib/avm/git/issue/complete/validations.rb +0 -54
- data/sub/avm-git/lib/avm/git/issue/complete/working_tree.rb +0 -19
- data/sub/avm-git/lib/avm/git/issue/complete.rb +0 -66
- data/sub/avm-git/lib/avm/git/issue.rb +0 -10
- data/sub/avm-git/lib/avm/git/launcher/base/class_methods.rb +0 -28
- data/sub/avm-git/lib/avm/git/launcher/base/dirty_files.rb +0 -21
- data/sub/avm-git/lib/avm/git/launcher/base/remotes.rb +0 -37
- data/sub/avm-git/lib/avm/git/launcher/base/subrepo.rb +0 -42
- data/sub/avm-git/lib/avm/git/launcher/base/underlying.rb +0 -54
- data/sub/avm-git/lib/avm/git/launcher/base.rb +0 -81
- data/sub/avm-git/lib/avm/git/launcher/error.rb +0 -13
- data/sub/avm-git/lib/avm/git/launcher/mirror_update.rb +0 -36
- data/sub/avm-git/lib/avm/git/launcher/publish_base.rb +0 -127
- data/sub/avm-git/lib/avm/git/launcher/remote.rb +0 -53
- data/sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb +0 -36
- data/sub/avm-git/lib/avm/git/launcher/warp_base.rb +0 -63
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git/local_project_mixin.rb +0 -16
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git/publish.rb +0 -13
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git/warp.rb +0 -25
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git.rb +0 -22
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subrepo/publish.rb +0 -29
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subrepo/warp.rb +0 -82
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subrepo.rb +0 -32
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subtree/publish.rb +0 -12
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subtree/warp.rb +0 -29
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/git_subtree.rb +0 -47
- data/sub/avm-git/lib/avm/git/launcher_stereotypes/provider.rb +0 -17
- data/sub/avm-git/lib/avm/git/launcher_stereotypes.rb +0 -9
- data/sub/avm-git/lib/avm/git/organize/reference_update.rb +0 -32
- data/sub/avm-git/lib/avm/git/organize/repository.rb +0 -74
- data/sub/avm-git/lib/avm/git/revision_test.rb +0 -102
- data/sub/avm-git/lib/avm/git/runners/base/commit.rb +0 -96
- data/sub/avm-git/lib/avm/git/runners/base/deploy.rb +0 -108
- data/sub/avm-git/lib/avm/git/runners/base/dirty_files.rb +0 -42
- data/sub/avm-git/lib/avm/git/runners/base/organize.rb +0 -72
- data/sub/avm-git/lib/avm/git/runners/base/revisions_test.rb +0 -63
- data/sub/avm-git/lib/avm/git/runners/base/subrepo/check.rb +0 -45
- data/sub/avm-git/lib/avm/git/runners/base/subrepo/clone.rb +0 -80
- data/sub/avm-git/lib/avm/git/runners/base/subrepo/fix.rb +0 -69
- data/sub/avm-git/lib/avm/git/runners/base/subrepo.rb +0 -17
- data/sub/avm-git/lib/avm/git/runners/base.rb +0 -40
- data/sub/avm-git/lib/avm/git/scms/git/branch.rb +0 -28
- data/sub/avm-git/lib/avm/git/scms/git/branches.rb +0 -17
- data/sub/avm-git/lib/avm/git/scms/git/change_tracker.rb +0 -34
- data/sub/avm-git/lib/avm/git/scms/git/changed_file.rb +0 -25
- data/sub/avm-git/lib/avm/git/scms/git/changed_files.rb +0 -21
- data/sub/avm-git/lib/avm/git/scms/git/commit/deploy.rb +0 -37
- data/sub/avm-git/lib/avm/git/scms/git/commit/deploy_methods.rb +0 -24
- data/sub/avm-git/lib/avm/git/scms/git/commit.rb +0 -64
- data/sub/avm-git/lib/avm/git/scms/git/commit_dirty.rb +0 -32
- data/sub/avm-git/lib/avm/git/scms/git/commits.rb +0 -44
- data/sub/avm-git/lib/avm/git/scms/git/interval.rb +0 -28
- data/sub/avm-git/lib/avm/git/scms/git/milestones.rb +0 -18
- data/sub/avm-git/lib/avm/git/scms/git/remote.rb +0 -18
- data/sub/avm-git/lib/avm/git/scms/git/remotes.rb +0 -29
- data/sub/avm-git/lib/avm/git/scms/git/run_commit.rb +0 -54
- data/sub/avm-git/lib/avm/git/scms/git.rb +0 -46
- data/sub/avm-git/lib/avm/git/scms/git_sub_base/changed_file.rb +0 -19
- data/sub/avm-git/lib/avm/git/scms/git_sub_base/commit.rb +0 -23
- data/sub/avm-git/lib/avm/git/scms/git_sub_base/interval.rb +0 -23
- data/sub/avm-git/lib/avm/git/scms/git_sub_base.rb +0 -30
- data/sub/avm-git/lib/avm/git/scms/git_subrepo.rb +0 -33
- data/sub/avm-git/lib/avm/git/scms/git_subtree.rb +0 -29
- data/sub/avm-git/lib/avm/git/scms/provider.rb +0 -16
- data/sub/avm-git/lib/avm/git/scms.rb +0 -9
- data/sub/avm-git/lib/avm/git/subrepo_check/parent.rb +0 -48
- data/sub/avm-git/lib/avm/git/subrepo_check/remote.rb +0 -86
- data/sub/avm-git/lib/avm/git/subrepo_check/show_result.rb +0 -30
- data/sub/avm-git/lib/avm/git/subrepo_check.rb +0 -36
- data/sub/avm-git/lib/avm/git/subrepo_checks.rb +0 -57
- data/sub/avm-git/lib/avm/git/vendor/github.rb +0 -20
- data/sub/avm-git/lib/avm/git/vendor.rb +0 -9
- data/sub/avm-git/locale/en.yml +0 -6
- data/sub/avm-git/locale/pt-BR.yml +0 -6
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec.rb +0 -13
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/add.source.out +0 -1
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/add.target.yaml +0 -7
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/modify.source.out +0 -1
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/modify.target.yaml +0 -7
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/remove.source.out +0 -1
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/remove.target.yaml +0 -7
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename.source.out +0 -2
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename.target.yaml +0 -13
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename_modify.source.out +0 -2
- data/sub/avm-git/spec/lib/avm/git/commit/diff_tree_line_spec_files/rename_modify.target.yaml +0 -13
- data/sub/avm-git/spec/lib/avm/git/commit_spec.rb +0 -56
- data/sub/avm-git/spec/lib/avm/git/launcher/base_spec.rb +0 -45
- data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/publish_spec.rb +0 -83
- data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/publish_spec_files/config.yml +0 -5
- data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/publish_spec_settings.yml +0 -6
- data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec.rb +0 -53
- data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec_files/config.yml +0 -3
- data/sub/avm-git/spec/lib/avm/git/launcher_stereotypes/git_subrepo/warp_spec_settings.yml +0 -6
- data/sub/avm-git/spec/lib/avm/git/runners/base/deploy_spec.rb +0 -126
- data/sub/avm-git/spec/lib/avm/git/runners/base/deploy_spec_files/append1/stub3.txt.template +0 -1
- data/sub/avm-git/spec/lib/avm/git/runners/base/deploy_spec_files/append2/stub4.txt +0 -1
- data/sub/avm-git/spec/lib/avm/git/scms/git/commit/deploy_spec.rb +0 -92
- data/sub/avm-git/spec/lib/avm/git/scms/git_spec.rb +0 -8
- data/sub/avm-git/spec/lib/avm/git/scms/git_subrepo_spec.rb +0 -8
- data/sub/avm-git/spec/lib/avm/git/vendor/github_spec.rb +0 -23
- /data/sub/{avm-git → avm-eac_redmine_base0}/Gemfile +0 -0
- /data/sub/{avm-git → avm-eac_redmine_base0}/spec/rubocop_spec.rb +0 -0
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module Git
|
|
5
|
-
module Launcher
|
|
6
|
-
class Base < ::Avm::Launcher::Paths::Real
|
|
7
|
-
require_sub __FILE__
|
|
8
|
-
enable_simple_cache
|
|
9
|
-
extend ::Avm::Git::Launcher::Base::ClassMethods
|
|
10
|
-
include ::Avm::Git::Launcher::Base::DirtyFiles
|
|
11
|
-
include ::Avm::Git::Launcher::Base::Remotes
|
|
12
|
-
include ::Avm::Git::Launcher::Base::Subrepo
|
|
13
|
-
include ::Avm::Git::Launcher::Base::Underlying
|
|
14
|
-
|
|
15
|
-
attr_reader :eac_git
|
|
16
|
-
|
|
17
|
-
delegate :merge_base, :rev_parse, to: :eac_git
|
|
18
|
-
|
|
19
|
-
def initialize(path)
|
|
20
|
-
super
|
|
21
|
-
|
|
22
|
-
@eac_git = ::EacGit::Local.new(path)
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def init_bare
|
|
26
|
-
FileUtils.mkdir_p(self)
|
|
27
|
-
::EacRubyUtils::Envs.local.command('git', 'init', '--bare', self).execute! unless
|
|
28
|
-
File.exist?(subpath('.git'))
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
# @return [Pathname]
|
|
32
|
-
def root_path
|
|
33
|
-
@root_path ||= self.class.find_root(to_s)
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def descendant?(descendant, ancestor)
|
|
37
|
-
base = merge_base(descendant, ancestor)
|
|
38
|
-
return false if base.blank?
|
|
39
|
-
|
|
40
|
-
revparse = execute!('rev-parse', '--verify', ancestor).strip
|
|
41
|
-
base == revparse
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def subtree_split(prefix)
|
|
45
|
-
execute!('subtree', '-q', 'split', '-P', prefix).strip
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def push(remote_name, refspecs, options = {})
|
|
49
|
-
refspecs = [refspecs] unless refspecs.is_a?(Array)
|
|
50
|
-
args = ['push']
|
|
51
|
-
args << '--dry-run' if options[:dryrun]
|
|
52
|
-
args << '--force' if options[:force]
|
|
53
|
-
system!(args + [remote_name] + refspecs)
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
def push_all(remote_name)
|
|
57
|
-
system!('push', '--all', remote_name)
|
|
58
|
-
system!('push', '--tags', remote_name)
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def fetch(remote_name, options = {})
|
|
62
|
-
args = ['fetch', '-p', remote_name]
|
|
63
|
-
args += %w[--tags --prune-tags --force] if options[:tags]
|
|
64
|
-
execute!(*args)
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
def current_branch
|
|
68
|
-
execute!(%w[symbolic-ref -q HEAD]).gsub(%r{\Arefs/heads/}, '').strip
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
def reset_hard(ref)
|
|
72
|
-
execute!('reset', '--hard', ref)
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
def raise(message)
|
|
76
|
-
::Kernel.raise Avm::Git::Launcher::Error.new(self, message)
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
end
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module Git
|
|
5
|
-
module Launcher
|
|
6
|
-
class MirrorUpdate < ::Avm::Launcher::Paths::Real
|
|
7
|
-
include ::EacRubyUtils::SimpleCache
|
|
8
|
-
|
|
9
|
-
def initialize(target_path, source_path, source_rev)
|
|
10
|
-
super(target_path)
|
|
11
|
-
@target_git = ::Avm::Git::Launcher::Base.new(self)
|
|
12
|
-
@source_git = ::Avm::Git::Launcher::Base.new(source_path)
|
|
13
|
-
@source_rev = source_rev
|
|
14
|
-
run
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
private
|
|
18
|
-
|
|
19
|
-
def run
|
|
20
|
-
fetch_remote_source
|
|
21
|
-
reset_source_rev
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def fetch_remote_source
|
|
25
|
-
@target_git.git
|
|
26
|
-
@target_git.assert_remote_url('origin', @source_git)
|
|
27
|
-
@target_git.fetch('origin', tags: true)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def reset_source_rev
|
|
31
|
-
@target_git.reset_hard(@source_git.rev_parse(@source_rev, true))
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module Git
|
|
5
|
-
module Launcher
|
|
6
|
-
class PublishBase < ::Avm::Launcher::Publish::Base
|
|
7
|
-
include ::EacRubyUtils::SimpleCache
|
|
8
|
-
enable_speaker
|
|
9
|
-
|
|
10
|
-
CHECKERS = %w[remote_url remote_fetch publish_remote_no_exist remote_equal remote_following
|
|
11
|
-
local_following].freeze
|
|
12
|
-
|
|
13
|
-
DEFAULT_REMOTE_REF = 'master'
|
|
14
|
-
|
|
15
|
-
REMOTE_UNAVAILABLE_MESSAGES = ['could not resolve host', 'connection timed out',
|
|
16
|
-
'no route to host'].map(&:downcase).freeze
|
|
17
|
-
|
|
18
|
-
protected
|
|
19
|
-
|
|
20
|
-
def internal_check
|
|
21
|
-
CHECKERS.each do |checker|
|
|
22
|
-
result = send("#{checker}_check_result")
|
|
23
|
-
return result if result
|
|
24
|
-
end
|
|
25
|
-
divergent_result_check_result
|
|
26
|
-
rescue ::Avm::Launcher::Instances::Error => e
|
|
27
|
-
::Avm::Launcher::Publish::CheckResult.blocked(e.message)
|
|
28
|
-
rescue ::StandardError => e
|
|
29
|
-
raise e unless remote_unavailable_error?(e)
|
|
30
|
-
|
|
31
|
-
::Avm::Launcher::Publish::CheckResult.blocked(e.message)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
private
|
|
35
|
-
|
|
36
|
-
def remote_url_check_result
|
|
37
|
-
remote = sgit.remote(remote_name)
|
|
38
|
-
return if remote.exist? && remote.url.present?
|
|
39
|
-
|
|
40
|
-
::Avm::Launcher::Publish::CheckResult.blocked("Remote \"#{remote_name}\" has blank path")
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def remote_fetch_check_result
|
|
44
|
-
remote_fetch
|
|
45
|
-
nil
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def remote_unavailable_error?(error)
|
|
49
|
-
error_message = error.message.downcase
|
|
50
|
-
REMOTE_UNAVAILABLE_MESSAGES.any? do |message|
|
|
51
|
-
error_message.include?(message)
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
def publish_remote_no_exist_check_result
|
|
56
|
-
return nil if sgit.remote_exist?(remote_name)
|
|
57
|
-
|
|
58
|
-
::Avm::Launcher::Publish::CheckResult.blocked('Remote does not exist')
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def remote_equal_check_result
|
|
62
|
-
return nil unless remote_sha.present? && remote_sha == local_sha
|
|
63
|
-
|
|
64
|
-
::Avm::Launcher::Publish::CheckResult.updated('Remote equal')
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
def remote_following_check_result
|
|
68
|
-
return nil unless remote_sha.present? && sgit.descendant?(remote_sha, local_sha)
|
|
69
|
-
|
|
70
|
-
::Avm::Launcher::Publish::CheckResult.outdated('Remote following')
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
def divergent_result_check_result
|
|
74
|
-
::Avm::Launcher::Publish::CheckResult.blocked(
|
|
75
|
-
"Divergent (L: #{local_sha}, R: #{remote_sha})"
|
|
76
|
-
)
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
def local_following?
|
|
80
|
-
return true if remote_sha.blank?
|
|
81
|
-
|
|
82
|
-
sgit.descendant?(local_sha, remote_sha)
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
def local_following_check_result
|
|
86
|
-
return nil unless local_following?
|
|
87
|
-
|
|
88
|
-
::Avm::Launcher::Publish::CheckResult.pending('Local following')
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
def sgit_uncached
|
|
92
|
-
::Avm::Git::Launcher::Base.new(instance.warped)
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
def publish
|
|
96
|
-
info 'Pushing...'
|
|
97
|
-
sgit.push(remote_name, 'HEAD:master',
|
|
98
|
-
dryrun: !::Avm::Launcher::Context.current.publish_options[:confirm])
|
|
99
|
-
info 'Pushed!'
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
def local_sha
|
|
103
|
-
sgit.git.object('HEAD').sha
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
def remote_sha_uncached
|
|
107
|
-
remote_fetch
|
|
108
|
-
b = sgit.git.branches["#{remote_name}/#{remote_ref}"]
|
|
109
|
-
b&.gcommit&.sha
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
def remote_fetch_uncached
|
|
113
|
-
sgit.fetch(remote_name)
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
def remote_name
|
|
117
|
-
::Avm::Git::Launcher::WarpBase::TARGET_REMOTE
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
# @return [String]
|
|
121
|
-
def remote_ref
|
|
122
|
-
DEFAULT_REMOTE_REF
|
|
123
|
-
end
|
|
124
|
-
end
|
|
125
|
-
end
|
|
126
|
-
end
|
|
127
|
-
end
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module Git
|
|
5
|
-
module Launcher
|
|
6
|
-
class Remote
|
|
7
|
-
common_constructor :git, :name
|
|
8
|
-
|
|
9
|
-
def exist?
|
|
10
|
-
git.execute!('remote').each_line.any? { |line| line.strip == name }
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def ls
|
|
14
|
-
git.execute!(['ls-remote', name]).each_line.to_h do |line|
|
|
15
|
-
x = line.strip.split(/\s+/)
|
|
16
|
-
[x[1], x[0]]
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
# +git remote add ...+
|
|
21
|
-
def add(url)
|
|
22
|
-
git.execute!('remote', 'add', name, url)
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
# +git remote rm ...+
|
|
26
|
-
def remove
|
|
27
|
-
git.execute!('remote', 'rm', name)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# +git remote get-url ...+
|
|
31
|
-
def url
|
|
32
|
-
git.execute!('remote', 'get-url', name).strip.if_present(nil)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# git remote set-url ...
|
|
36
|
-
def url_set(url)
|
|
37
|
-
git.execute!('remote', 'set-url', name, url)
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
# Add or set URL if +url+ is present, remove remote if is blank.
|
|
41
|
-
def url=(url)
|
|
42
|
-
if exist? && url.blank?
|
|
43
|
-
remove
|
|
44
|
-
elsif exist? && self.url != url
|
|
45
|
-
url_set(url)
|
|
46
|
-
elsif !exist?
|
|
47
|
-
add(url)
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module Git
|
|
5
|
-
module Launcher
|
|
6
|
-
module SubWarpBase
|
|
7
|
-
private
|
|
8
|
-
|
|
9
|
-
def parent_instance_uncached
|
|
10
|
-
if instance.parent.blank?
|
|
11
|
-
raise ::Avm::Launcher::Errors::Base,
|
|
12
|
-
'Instance is a GitSubrepo, but do not have a parent Git repository (Logical ' \
|
|
13
|
-
"path: \"#{instance}\", Real path: \"#{instance.real}\")"
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
r = find_parent_instance(instance.parent)
|
|
17
|
-
return r if r
|
|
18
|
-
|
|
19
|
-
::Avm::Launcher::Errors::Base.new('Git parent not found')
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def find_parent_instance(current)
|
|
23
|
-
if ::Avm::Launcher::Stereotype.git_stereotypes.any? { |s| current.stereotype?(s) }
|
|
24
|
-
return current
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
current.parent ? find_parent_instance(current.parent) : nil
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def to_parent_git_path
|
|
31
|
-
instance.logical.gsub(%r{\A#{Regexp.quote(parent_instance.logical)}/}, '')
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module Git
|
|
5
|
-
module Launcher
|
|
6
|
-
# Métodos abstratos:
|
|
7
|
-
# * source_instance
|
|
8
|
-
# * source_remote_name
|
|
9
|
-
# * current_ref
|
|
10
|
-
class WarpBase < ::Avm::Launcher::Paths::Real
|
|
11
|
-
include ::EacRubyUtils::SimpleCache
|
|
12
|
-
|
|
13
|
-
TARGET_REMOTE = ::Avm::Git::LauncherStereotypes::Git::Publish::PUBLISH_GIT_REMOTE_NAME
|
|
14
|
-
|
|
15
|
-
def initialize(instance)
|
|
16
|
-
@instance = instance
|
|
17
|
-
cache_git.git.reset_hard(current_ref)
|
|
18
|
-
cache_git.remote(TARGET_REMOTE).url = target_remote_url
|
|
19
|
-
super(path)
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
protected
|
|
23
|
-
|
|
24
|
-
attr_reader :instance
|
|
25
|
-
|
|
26
|
-
def validate_source_current_revision
|
|
27
|
-
if source_git.rev_parse(source_instance.options.git_current_revision, false).present?
|
|
28
|
-
return
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
raise ::Avm::Launcher::Instances::Error,
|
|
32
|
-
"Refspec \"#{source_instance.options.git_current_revision}\" " \
|
|
33
|
-
"not found in \"#{source_git}\""
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def update
|
|
37
|
-
validate_source_current_revision
|
|
38
|
-
::Avm::Git::Launcher::MirrorUpdate.new(
|
|
39
|
-
path,
|
|
40
|
-
source_instance.real,
|
|
41
|
-
source_instance.options.git_current_revision
|
|
42
|
-
)
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
def path
|
|
46
|
-
instance.cache_path('git_repository')
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def source_git_uncached
|
|
50
|
-
::Avm::Git::Launcher::Base.new(source_instance.real)
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def cache_git_uncached
|
|
54
|
-
::Avm::Git::Launcher::Base.new(update)
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def target_remote_url
|
|
58
|
-
::Avm::Git::Vendor::Github.to_ssh_url(source_git.git.remote(source_remote_name).url)
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module Git
|
|
5
|
-
module LauncherStereotypes
|
|
6
|
-
class Git
|
|
7
|
-
module LocalProjectMixin
|
|
8
|
-
# @return [EacGit::Local]
|
|
9
|
-
def git_repo
|
|
10
|
-
@git_repo ||= ::EacGit::Local.new(path)
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module Git
|
|
5
|
-
module LauncherStereotypes
|
|
6
|
-
class Git
|
|
7
|
-
class Warp < ::Avm::Git::Launcher::WarpBase
|
|
8
|
-
private
|
|
9
|
-
|
|
10
|
-
def current_ref
|
|
11
|
-
'HEAD'
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def source_instance
|
|
15
|
-
instance
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def source_remote_name
|
|
19
|
-
::Avm::Git::LauncherStereotypes::Git::Publish::PUBLISH_GIT_REMOTE_NAME
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module Git
|
|
5
|
-
module LauncherStereotypes
|
|
6
|
-
class Git
|
|
7
|
-
require_sub __FILE__
|
|
8
|
-
include Avm::Launcher::Stereotype
|
|
9
|
-
|
|
10
|
-
class << self
|
|
11
|
-
def match?(path)
|
|
12
|
-
File.directory?(path.real.subpath('.git'))
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def color
|
|
16
|
-
:white
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module Git
|
|
5
|
-
module LauncherStereotypes
|
|
6
|
-
class GitSubrepo
|
|
7
|
-
class Publish < ::Avm::Git::Launcher::PublishBase
|
|
8
|
-
# @return [Pathname]
|
|
9
|
-
def config_path
|
|
10
|
-
instance.parent.warped.to_pathname.join(
|
|
11
|
-
"./#{instance.to_parent_path}",
|
|
12
|
-
::Avm::Git::LauncherStereotypes::GitSubrepo::CONFIG_SUBPATH
|
|
13
|
-
)
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
# @return [EacGit::Local::Subrepo::Config]
|
|
17
|
-
def config
|
|
18
|
-
::EacGit::Local::Subrepo::Config.from_file(config_path)
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
# @return [String]
|
|
22
|
-
def remote_ref
|
|
23
|
-
config.remote_branch || super
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module Git
|
|
5
|
-
module LauncherStereotypes
|
|
6
|
-
class GitSubrepo
|
|
7
|
-
class Warp < ::Avm::Launcher::Paths::Real
|
|
8
|
-
include ::Avm::Git::Launcher::SubWarpBase
|
|
9
|
-
include ::EacRubyUtils::SimpleCache
|
|
10
|
-
|
|
11
|
-
attr_reader :instance
|
|
12
|
-
|
|
13
|
-
def initialize(instance)
|
|
14
|
-
@instance = instance
|
|
15
|
-
check_parent
|
|
16
|
-
init_aux
|
|
17
|
-
push_to_aux
|
|
18
|
-
reset
|
|
19
|
-
assert_target_remote
|
|
20
|
-
super(warped_git)
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
private
|
|
24
|
-
|
|
25
|
-
def check_parent
|
|
26
|
-
return if parent_git_warped.rev_parse(subrepo_parent_hash) &&
|
|
27
|
-
parent_git_warped.descendant?('HEAD', subrepo_parent_hash)
|
|
28
|
-
|
|
29
|
-
raise Avm::Launcher::Errors::Base,
|
|
30
|
-
"Subrepo parent hash \"#{subrepo_parent_hash}\" " \
|
|
31
|
-
"not found in \"#{parent_git_warped}\""
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def subrepo_parent_hash
|
|
35
|
-
data = parent_git_warped.subrepo_status(to_parent_git_path)
|
|
36
|
-
h = data['Pull Parent']
|
|
37
|
-
return h if h.present?
|
|
38
|
-
|
|
39
|
-
raise Avm::Launcher::Errors::Base, "Subrepo parent hash is blank: #{data}"
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def init_aux
|
|
43
|
-
::Avm::Git::Launcher::Base.new(aux_path).init_bare
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def parent_git_warped_uncached
|
|
47
|
-
::Avm::Git::Launcher::Base.new(parent_instance.warped)
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def aux_path
|
|
51
|
-
instance.cache_path('subrepo_aux_git_repository')
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def warped_git_uncached
|
|
55
|
-
::Avm::Git::Launcher::Base.new(instance.cache_path('git_repository'))
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def push_to_aux
|
|
59
|
-
parent_git_warped.execute!('subrepo', 'branch', to_parent_git_path, '-fF')
|
|
60
|
-
h = parent_git_warped.rev_parse("subrepo/#{to_parent_git_path}", true)
|
|
61
|
-
parent_git_warped.execute!('push', aux_path, "#{h}:refs/heads/master", '--force')
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
def reset
|
|
65
|
-
::Avm::Git::Launcher::MirrorUpdate.new(warped_git, aux_path, 'master')
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
def assert_target_remote
|
|
69
|
-
warped_git.assert_remote_url(::Avm::Git::Launcher::WarpBase::TARGET_REMOTE,
|
|
70
|
-
target_remote_url)
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
def target_remote_url
|
|
74
|
-
::Avm::Git::Vendor::Github.to_ssh_url(
|
|
75
|
-
parent_git_warped.subrepo_remote_url(to_parent_git_path)
|
|
76
|
-
)
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
end
|
|
82
|
-
end
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module Git
|
|
5
|
-
module LauncherStereotypes
|
|
6
|
-
class GitSubrepo
|
|
7
|
-
require_sub __FILE__
|
|
8
|
-
include Avm::Launcher::Stereotype
|
|
9
|
-
|
|
10
|
-
CONFIG_SUBPATH = '.gitrepo'
|
|
11
|
-
|
|
12
|
-
class << self
|
|
13
|
-
def match?(path)
|
|
14
|
-
File.exist?(path.real.subpath(CONFIG_SUBPATH)) && subrepo_url(path.real) != 'none'
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def color
|
|
18
|
-
:light_cyan
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def subrepo_url(path)
|
|
22
|
-
File.read(path.subpath(CONFIG_SUBPATH)).each_line do |l|
|
|
23
|
-
m = /remote\s*=\s(.+)/.match(l)
|
|
24
|
-
return m[1] if m
|
|
25
|
-
end
|
|
26
|
-
raise ::Avm::Git::Launcher::Error.new(path, '"remote = ... " not found')
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Avm
|
|
4
|
-
module Git
|
|
5
|
-
module LauncherStereotypes
|
|
6
|
-
class GitSubtree
|
|
7
|
-
class Warp < ::Avm::Git::Launcher::WarpBase
|
|
8
|
-
include ::Avm::Git::Launcher::SubWarpBase
|
|
9
|
-
|
|
10
|
-
private
|
|
11
|
-
|
|
12
|
-
def current_ref
|
|
13
|
-
instance.cache_key("git_subtree.parent.#{cache_git.git.object('HEAD').sha}") do
|
|
14
|
-
cache_git.subtree_split(to_parent_git_path)
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def source_instance
|
|
19
|
-
parent_instance
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def source_remote_name
|
|
23
|
-
instance.project_name
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|