diff --git a/tools/ci.py b/tools/ci.py index 204f5d3e9..0f197f03e 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -131,11 +131,27 @@ def daca2report(): subprocess.call(['python', 'tools/daca2-report.py', 'daca2-report']) 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): - folders = '0123456789abcdefghijklmnopqrstuvwxyz' - folder = folders[foldernum % len(folders)] + return oldestfolder +def daca2(): + folder = daca2folder() print('Daca2 folder=' + folder) p = subprocess.Popen(['git', 'show', '--format=%h'], @@ -158,7 +174,6 @@ def daca2(foldernum): daca2report() t0 = datetime.date.today() -foldernum = 0 while True: if datetime.date.today() != t0: print("generate daily reports") @@ -173,5 +188,4 @@ while True: if cmd.find("doxygen") >= 0: generate_webreport() - daca2(foldernum) - foldernum = foldernum + 1 + daca2()