Class: Wordmove::Deployer::SSH

Inherits:
Base
  • Object
show all
Defined in:
lib/wordmove/deployer/ssh.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#environment, #logger, #options

Instance Method Summary collapse

Methods inherited from Base

current_dir, deployer_for, #exclude_dir_contents, logger, #pull_wordpress, #push_wordpress, #remote_get_directory, #remote_put_directory

Constructor Details

#initialize(environment, options) ⇒ SSH

Returns a new instance of SSH.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/wordmove/deployer/ssh.rb', line 11

def initialize(environment, options)
  super(environment, options)
  ssh_options = remote_options[:ssh]

  if simulate? && ssh_options[:rsync_options]
    ssh_options[:rsync_options].concat(" --dry-run")
  elsif simulate?
    ssh_options[:rsync_options] = "--dry-run"
  end

  @copier = Photocopier::SSH.new(ssh_options).tap { |c| c.logger = logger }

  @local_dump_path = local_wp_content_dir.path("dump.sql")
  @local_backup_path = local_wp_content_dir.path("local-backup-#{Time.now.to_i}.sql")
  @local_gzipped_dump_path = local_dump_path + '.gz'
  @local_gzipped_backup_path = local_wp_content_dir
                               .path("#{environment}-backup-#{Time.now.to_i}.sql.gz")
end

Instance Attribute Details

#local_backup_pathObject (readonly)

Returns the value of attribute local_backup_path.



6
7
8
# File 'lib/wordmove/deployer/ssh.rb', line 6

def local_backup_path
  @local_backup_path
end

#local_dump_pathObject (readonly)

Returns the value of attribute local_dump_path.



6
7
8
# File 'lib/wordmove/deployer/ssh.rb', line 6

def local_dump_path
  @local_dump_path
end

#local_gzipped_backup_pathObject (readonly)

Returns the value of attribute local_gzipped_backup_path.



6
7
8
# File 'lib/wordmove/deployer/ssh.rb', line 6

def local_gzipped_backup_path
  @local_gzipped_backup_path
end

#local_gzipped_dump_pathObject (readonly)

Returns the value of attribute local_gzipped_dump_path.



6
7
8
# File 'lib/wordmove/deployer/ssh.rb', line 6

def local_gzipped_dump_path
  @local_gzipped_dump_path
end