Sha256: 2294818eca6872524442785ccc7fc100677a1efe05a7df60c53facfd07e5b006

Contents?: true

Size: 699 Bytes

Versions: 4

Compression:

Stored size: 699 Bytes

Contents

require_relative "helper.rb"

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

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

  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

  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
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
capistrano-container-db-0.0.4 lib/db/dump_helper.rb
capistrano-container-db-0.0.3 lib/db/dump_helper.rb
capistrano-container-db-0.0.2 lib/db/dump_helper.rb
capistrano-container-db-0.0.1 lib/db/dump_helper.rb