Class: Dumpman::Fetchers::Direct

Inherits:
Object
  • Object
show all
Defined in:
lib/dumpman/fetchers/direct.rb

Overview

it triggers rake db:dump inside app_path and copies dump into tmp directory after that it gets dump from remote server

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ssh_opts:, ssh_cmd:, app_path:, app_env:) ⇒ Direct

Returns a new instance of Direct.



10
11
12
13
14
15
# File 'lib/dumpman/fetchers/direct.rb', line 10

def initialize(ssh_opts:, ssh_cmd:, app_path:, app_env:, **)
  @ssh_opts = ssh_opts
  @ssh_cmd = ssh_cmd
  @app_path = app_path
  @app_env = app_env
end

Instance Attribute Details

#app_envObject (readonly)

Returns the value of attribute app_env.



8
9
10
# File 'lib/dumpman/fetchers/direct.rb', line 8

def app_env
  @app_env
end

#app_pathObject (readonly)

Returns the value of attribute app_path.



8
9
10
# File 'lib/dumpman/fetchers/direct.rb', line 8

def app_path
  @app_path
end

#ssh_cmdObject (readonly)

Returns the value of attribute ssh_cmd.



8
9
10
# File 'lib/dumpman/fetchers/direct.rb', line 8

def ssh_cmd
  @ssh_cmd
end

#ssh_optsObject (readonly)

Returns the value of attribute ssh_opts.



8
9
10
# File 'lib/dumpman/fetchers/direct.rb', line 8

def ssh_opts
  @ssh_opts
end

Instance Method Details

#get_dumpObject



17
18
19
20
21
# File 'lib/dumpman/fetchers/direct.rb', line 17

def get_dump
  Dumpman::Executor.system(make_dump_remotely) do |dump_location|
    Dumpman::Executor.system(fetch_dump_to_local(dump_location))
  end
end