Sha256: 5cb0ba89815a93d42d9cbc022bfc4f90b4083c4c2fb136a582eaf0145fe0fd22

Contents?: true

Size: 1.3 KB

Versions: 45

Compression:

Stored size: 1.3 KB

Contents

module Wordmove
  module Deployer
    module Ssh
      class DefaultSqlAdapter < SSH
        private

        def backup_remote_db!
          download_remote_db(local_gzipped_backup_path)
        end

        def adapt_local_db!
          save_local_db(local_dump_path)
          adapt_sql(local_dump_path, local_options, remote_options)
          run compress_command(local_dump_path)
          import_remote_dump(local_gzipped_dump_path)
        end

        def after_push_cleanup!
          local_delete(local_gzipped_dump_path)
        end

        def backup_local_db!
          save_local_db(local_backup_path)
          run compress_command(local_backup_path)
        end

        def adapt_remote_db!
          download_remote_db(local_gzipped_dump_path)
          run uncompress_command(local_gzipped_dump_path)
          adapt_sql(local_dump_path, remote_options, local_options)
          run mysql_import_command(local_dump_path, local_options[:database])
        end

        def after_pull_cleanup!
          local_delete(local_dump_path)
        end

        def adapt_sql(save_to_path, local, remote)
          return if options[:no_adapt]

          logger.task_step true, "Adapt dump"
          SqlAdapter::Default.new(save_to_path, local, remote).adapt! unless simulate?
        end
      end
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
wordmove-5.2.2 lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-5.2.1 lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-5.2.0 lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-5.1.0 lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-5.0.2 lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-5.0.1 lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-5.0.0.dev lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-5.0.0 lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-4.0.2.pre4 lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-4.0.2.pre3 lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-4.0.2.pre2 lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-4.0.2.pre1 lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-4.0.1 lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-4.0.0 lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-3.2.3 lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-3.2.3pre2 lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-3.2.3pre lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-3.2.2 lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-3.2.1 lib/wordmove/deployer/ssh/default_sql_adapter.rb
wordmove-3.2.0 lib/wordmove/deployer/ssh/default_sql_adapter.rb