Module: DumpHelper

Defined in:
lib/db/dump_helper.rb

Class Method Summary collapse

Class Method Details

.dump_on_container_and_download(container) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/db/dump_helper.rb', line 20

def self.dump_on_container_and_download(container)
  args = Helper::mysql_args(['--no-create-db'])

  container.execute("mysqldump #{args} > #{fetch(:db_remote_dump)}")

  container.download!(fetch(:db_remote_dump), fetch(:db_local_dump))
end

.dump_on_localObject



4
5
6
7
8
9
10
# File 'lib/db/dump_helper.rb', line 4

def self.dump_on_local()
  args = Helper::mysql_args(['--no-create-db'])

  run_locally do
    execute "mysqldump #{args} > #{fetch(:db_local_dump)}"
  end
end

.dump_on_server_and_downloadObject



12
13
14
15
16
17
18
# File 'lib/db/dump_helper.rb', line 12

def self.dump_on_server_and_download()
  args = Helper::mysql_args(['--no-create-db'])

  execute "mysqldump #{args} > #{fetch(:db_remote_dump)}"

  download!(fetch(:db_remote_dump), fetch(:db_local_dump))
end