CI: run daca2 on oldest folder
This commit is contained in:
parent
3c0619cba5
commit
b88fbb9857
26
tools/ci.py
26
tools/ci.py
|
@ -131,11 +131,27 @@ def daca2report():
|
||||||
subprocess.call(['python', 'tools/daca2-report.py', 'daca2-report'])
|
subprocess.call(['python', 'tools/daca2-report.py', 'daca2-report'])
|
||||||
upload('-r daca2-report', 'htdocs/devinfo/')
|
upload('-r daca2-report', 'htdocs/devinfo/')
|
||||||
|
|
||||||
|
def daca2folder():
|
||||||
|
oldresults = glob.glob(os.path.expanduser('~/daca2/*/results.txt'))
|
||||||
|
oldestfolder = None
|
||||||
|
oldestdate = None
|
||||||
|
for old in oldresults:
|
||||||
|
f = open(old,'rt')
|
||||||
|
filedata = f.read()
|
||||||
|
f.close()
|
||||||
|
pos = filedata.find('STARTDATE')
|
||||||
|
if pos < 0:
|
||||||
|
return old
|
||||||
|
startdate = filedata[pos+10:pos+20]
|
||||||
|
if not oldestdate or oldestdate > startdate:
|
||||||
|
oldestdate = startdate
|
||||||
|
pos = old.find('/daca2/')
|
||||||
|
oldestfolder = old[pos+7:old.find('/',pos+8)]
|
||||||
|
|
||||||
def daca2(foldernum):
|
return oldestfolder
|
||||||
folders = '0123456789abcdefghijklmnopqrstuvwxyz'
|
|
||||||
folder = folders[foldernum % len(folders)]
|
|
||||||
|
|
||||||
|
def daca2():
|
||||||
|
folder = daca2folder()
|
||||||
print('Daca2 folder=' + folder)
|
print('Daca2 folder=' + folder)
|
||||||
|
|
||||||
p = subprocess.Popen(['git', 'show', '--format=%h'],
|
p = subprocess.Popen(['git', 'show', '--format=%h'],
|
||||||
|
@ -158,7 +174,6 @@ def daca2(foldernum):
|
||||||
daca2report()
|
daca2report()
|
||||||
|
|
||||||
t0 = datetime.date.today()
|
t0 = datetime.date.today()
|
||||||
foldernum = 0
|
|
||||||
while True:
|
while True:
|
||||||
if datetime.date.today() != t0:
|
if datetime.date.today() != t0:
|
||||||
print("generate daily reports")
|
print("generate daily reports")
|
||||||
|
@ -173,5 +188,4 @@ while True:
|
||||||
if cmd.find("doxygen") >= 0:
|
if cmd.find("doxygen") >= 0:
|
||||||
generate_webreport()
|
generate_webreport()
|
||||||
|
|
||||||
daca2(foldernum)
|
daca2()
|
||||||
foldernum = foldernum + 1
|
|
||||||
|
|
Loading…
Reference in New Issue