Sha256: 699e4f64d92575a053ffb533d476c812459229ab2faab03e4402a1cb80a6162c

Contents?: true

Size: 1.23 KB

Versions: 57

Compression:

Stored size: 1.23 KB

Contents

# frozen_string_literal: true

module Avm
  module EacWebappBase0
    module Instances
      class Deploy
        class FileUnit < ::SimpleDelegator
          attr_reader :data_key, :fs_path_subpath

          def initialize(deploy, data_key, fs_path_subpath)
            super(deploy)
            @data_key = data_key
            @fs_path_subpath = fs_path_subpath
          end

          def run
            assert_source_directory
            link_source_target
          end

          def assert_source_directory
            infom "Asserting \"#{data_key}\" source directory..."
            instance.host_env.command('mkdir', '-p', source_path).execute!
          end

          def source_path
            ::File.join(instance.install_data_path, data_key.to_s)
          end

          def target_path
            ::File.join(instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH),
                        fs_path_subpath.to_s)
          end

          def link_source_target
            infom "Linking \"#{data_key}\" directory..."
            instance.host_env.command('rm', '-rf', target_path).execute!
            instance.host_env.command('ln', '-s', source_path, target_path).execute!
          end
        end
      end
    end
  end
end

Version data entries

57 entries across 57 versions & 2 rubygems

Version Path
eac_tools-0.39.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
avm-eac_webapp_base0-0.12.0 lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.38.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
avm-eac_webapp_base0-0.11.0 lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.37.2 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
avm-eac_webapp_base0-0.10.0 lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.37.1 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.37.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.36.1 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
avm-eac_webapp_base0-0.9.2 lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.36.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
avm-eac_webapp_base0-0.9.1 lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.35.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.34.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.33.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
avm-eac_webapp_base0-0.9.0 lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb
eac_tools-0.32.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/file_unit.rb