def report_build(self, build_data, name):
     duration = time.time() - self.lastrun
     if build_data[1]:
         log = build_data[0] + "\n STDERROR: \n" + build_data[1]
     else:
         log = build_data[0]
     result = jenkins.runResult(log, "Success?", duration)
     result.send(util.conf()['jenkins']['url'], name)
 def store_ftp(self, zip_loc, name, job_id):
     "optional fall back if camlistore doesn't pan out"
     conf = util.conf()['ftp']
     f = ftplib.FTP_TLS(conf['ftp_host']) #We don't actually want to upload here
     f.login() #Anonymous login
     f.prot_p() #secure the line
     f.cwd(os.path.join(conf['remotepath'], name))
     f.storbinary("STOR %s" % os.path.split(zip_loc)[1], open(zip_loc))
 def report_build(self, build_data, name):
     duration = time.time() - self.lastrun
     if  build_data[1]:
         log = build_data[0] + "\n STDERROR: \n" + build_data[1]
     else:
         log = build_data[0]
     result = jenkins.runResult(log, "Success?", duration)
     result.send(util.conf()['jenkins']['url'], name)
 def store_zip(self, zip_loc, name, job_id):
     conf = util.conf()['camli']
     op = camli.op.CamliOp(conf['url'], auth=conf['auth'], basepath=conf['basepath'])
     blobref = op.put_blobs([open(zip_loc)]) #list does matter
     if len(blobref) == 1:
         blobref_clean = blobref.pop()
     else:
         raise ValueError("Multiple blobrefs!")
     self.tell_queen(blobref_clean, name, job_id)
 def store_ftp(self, zip_loc, name, job_id):
     "optional fall back if camlistore doesn't pan out"
     conf = util.conf()['ftp']
     f = ftplib.FTP_TLS(
         conf['ftp_host'])  #We don't actually want to upload here
     f.login()  #Anonymous login
     f.prot_p()  #secure the line
     f.cwd(os.path.join(conf['remotepath'], name))
     f.storbinary("STOR %s" % os.path.split(zip_loc)[1], open(zip_loc))
 def store_zip(self, zip_loc, name, job_id):
     conf = util.conf()['camli']
     op = camli.op.CamliOp(conf['url'],
                           auth=conf['auth'],
                           basepath=conf['basepath'])
     blobref = op.put_blobs([open(zip_loc)])  #list does matter
     if len(blobref) == 1:
         blobref_clean = blobref.pop()
     else:
         raise ValueError("Multiple blobrefs!")
     self.tell_queen(blobref_clean, name, job_id)
 def run(self):
     self.lastrun = 0
     self.notbuilding = True
     while 1:
         #Query the builddrone queen.
         if time.time() - self.lastrun > 60*5 and self.notbuilding:
             u = urllib2.urlopen("http://%s/jobs" \
             % util.conf()['queen']['url']).read() 
             #TODO: ask for GCC/arch jobid
             #TODO care about user prefrence on arch, use platform.processor()
             data = json.loads(u) 
             self.lastrun = time.time()
             self.process_jobs(data)
             self.notbuilding = True
         else:
             pass
 def run(self):
     self.lastrun = 0
     self.notbuilding = True
     while 1:
         #Query the builddrone queen.
         if time.time() - self.lastrun > 60 * 5 and self.notbuilding:
             u = urllib2.urlopen("http://%s/jobs" \
             % util.conf()['queen']['url']).read()
             #TODO: ask for GCC/arch jobid
             #TODO care about user prefrence on arch, use platform.processor()
             data = json.loads(u)
             self.lastrun = time.time()
             self.process_jobs(data)
             self.notbuilding = True
         else:
             pass
 def tell_queen(self, blobref, name, job_id):
     urllib2.urlopen("http://%(server)s/completed/%(job_id)s/%(blobref)s" \
     % {'server': util.conf()['queen']['url'], 'job_id': job_id, 'blobref': blobref})
 def tell_queen(self, blobref, name, job_id):
     urllib2.urlopen("http://%(server)s/completed/%(job_id)s/%(blobref)s" \
     % {'server': util.conf()['queen']['url'], 'job_id': job_id, 'blobref': blobref})