Class: CircleCI::Parallel::Task::Master::Downloader Private

Inherits:
Struct
  • Object
show all
Defined in:
lib/circleci/parallel/task/master.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#downloadObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



40
41
42
43
44
45
46
# File 'lib/circleci/parallel/task/master.rb', line 40

def download
  return if downloaded?
  return unless ready_for_download?
  Parallel.puts("Downloading data from #{node.ssh_host}...")
  @downloaded = scp
  mark_as_downloaded if downloaded?
end

#downloaded?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



52
53
54
# File 'lib/circleci/parallel/task/master.rb', line 52

def downloaded?
  @downloaded
end

#mark_as_downloadedObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



56
57
58
# File 'lib/circleci/parallel/task/master.rb', line 56

def mark_as_downloaded
  Kernel.system('ssh', node.ssh_host, 'touch', DOWNLOAD_MARKER_FILE)
end

#ready_for_download?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



36
37
38
# File 'lib/circleci/parallel/task/master.rb', line 36

def ready_for_download?
  Kernel.system('ssh', node.ssh_host, 'test', '-f', SYNC_MARKER_FILE)
end

#scpObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



48
49
50
# File 'lib/circleci/parallel/task/master.rb', line 48

def scp
  Kernel.system('scp', '-q', '-r', "#{node.ssh_host}:#{node.data_dir}", BASE_DATA_DIR)
end