From b88fbb9857c471782c7d91fb27f9a7f07c5e6f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 7 Feb 2014 06:37:42 +0100 Subject: [PATCH] CI: run daca2 on oldest folder --- tools/ci.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) 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()