Sha256: 99b0df881d60a0e622377161d619606c41238be92aa3a456e10fd36706f1d4b6

Contents?: true

Size: 1.15 KB

Versions: 97

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true

module Avm
  module EacWebappBase0
    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.read_entry(:data_fs_path), data_key.to_s)
        end

        def target_path
          ::File.join(instance.read_entry(::Avm::Instances::EntryKeys::FS_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

Version data entries

97 entries across 97 versions & 3 rubygems

Version Path
eac_tools-0.24.1 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb
eac_tools-0.24.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb
avm-eac_webapp_base0-0.4.0 lib/avm/eac_webapp_base0/deploy/file_unit.rb
eac_tools-0.23.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb
eac_tools-0.22.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb
eac_tools-0.21.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb
eac_tools-0.20.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb
eac_tools-0.19.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb
eac_tools-0.18.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb
eac_tools-0.17.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb
eac_tools-0.16.1 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb
eac_tools-0.16.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb
avm-eac_webapp_base0-0.3.1 lib/avm/eac_webapp_base0/deploy/file_unit.rb
eac_tools-0.15.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.120.2 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.120.1 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.120.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.119.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.118.0 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.117.3 sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy/file_unit.rb