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.



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

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.

Returns:

  • (Boolean)


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

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.



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

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.

Returns:

  • (Boolean)


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

def ready_for_download?
  Kernel.system('ssh', node.ssh_host, 'test', '-f', JOIN_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.



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

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