Esempio n. 1
0
 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)
Esempio n. 2
0
 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))
Esempio n. 3
0
 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)
Esempio n. 4
0
 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)
Esempio n. 5
0
 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))
Esempio n. 6
0
 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)
Esempio n. 7
0
 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
Esempio n. 8
0
 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
Esempio n. 9
0
 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})
Esempio n. 10
0
 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})