Sha256: eecc6c1e6db7efbbb31de14056ba3e37029a1a90a83e47e286645d538c58fe37

Contents?: true

Size: 1.19 KB

Versions: 32

Compression:

Stored size: 1.19 KB

Contents

# frozen_string_literal: true

module Avm
  module Stereotypes
    module EacWebappBase0
      class Deploy
        class FilesUnit < ::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(: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
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
avm-tools-0.54.2 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.54.1 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.54.0 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.53.0 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.52.0 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.51.0 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.50.0 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.49.0 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.48.0 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.47.0 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.46.0 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.45.0 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.44.2 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.44.1 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.44.0 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.43.0 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.42.0 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.41.0 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.40.0 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb
avm-tools-0.39.0 lib/avm/stereotypes/eac_webapp_base0/deploy/file_unit.rb