Method: Hive::FileSystem#fetch_build

Defined in:
lib/hive/file_system.rb

#fetch_build(build_url, destination_path) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/hive/file_system.rb', line 46

def fetch_build(build_url, destination_path)
  base_url      = Hive.config.network['scheduler']
  apk_url       = base_url + '/' + build_url
  
  job = Hive::Messages::Job.new
  response = job.fetch(apk_url)

  tempfile = Tempfile.new('build.apk')
    File.open(tempfile.path,'w') do |f|
    f.write response.body
  end

  copy_file(tempfile.path, destination_path)
  check_build_integrity( destination_path )
end