From 1a1d4daed19e7b8220aeddbb335d46f9b723f8b7 Mon Sep 17 00:00:00 2001 From: alexjacks92 Date: Tue, 14 Jan 2014 16:31:16 -0500 Subject: [PATCH 1/2] Added ability to choose either master or develop branch for Jenkins testing. --- test/script/srcupdater.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/script/srcupdater.py b/test/script/srcupdater.py index 9a46d002df..7f9ebc2572 100644 --- a/test/script/srcupdater.py +++ b/test/script/srcupdater.py @@ -20,7 +20,7 @@ def compile(errore, attachli, parsedin): global to global server global subj - global email_enabled + global email_enabled global redo global tryredo global failedbool @@ -40,7 +40,7 @@ def compile(errore, attachli, parsedin): gitPull("sleuthkit") if(passed): vsBuild() - print("TSK") + print("TSK") if(passed): gitPull("autopsy") if(passed): @@ -60,7 +60,7 @@ def compile(errore, attachli, parsedin): if(tryredo): errorem = "" errorem += "Rebuilt properly.\n" - if email_enabled: + if email_enabled: Emailer.send_email(to, server, subj, errorem, attachl) attachl = [] passed = True @@ -114,7 +114,7 @@ def vsBuild(): if(not tryredo): errorem += "LIBTSK C++ failed to build.\n" attachl.append(VSpth) - if email_enabled: + if email_enabled: Emailer.send_email(parsed, errorem, attachl, False) tryredo = True passed = False @@ -157,7 +157,7 @@ def antBuild(which, Build): if(not tryredo): errorem += "DataModel Java build failed.\n" attachl.append(antpth) - if email_enabled: + if email_enabled: Emailer.send_email(to, server, subj, errorem, attachl) passed = False tryredo = True @@ -174,7 +174,7 @@ def main(): global email_enabled global to global server - global subj + global subj errore = "" attachli = [] config_file = "" @@ -188,8 +188,8 @@ def main(): subj = parsedin.getElementsByTagName("subject")[0].getAttribute("value").encode().decode("utf_8") except Exception: email_enabled = False - # email_enabled = (to is not None) and (server is not None) and (subj is not None) - email_enabled = False + # email_enabled = (to is not None) and (server is not None) and (subj is not None) + email_enabled = False compile(errore, attachli, parsedin) class OS: From dce2811acb4b4509e452a53ac66fe856a97b18b1 Mon Sep 17 00:00:00 2001 From: alexjacks92 Date: Tue, 14 Jan 2014 16:39:56 -0500 Subject: [PATCH 2/2] Wrong commit last time. Fixing that. --- test/script/srcupdater.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/script/srcupdater.py b/test/script/srcupdater.py index 7f9ebc2572..a86417d6e9 100644 --- a/test/script/srcupdater.py +++ b/test/script/srcupdater.py @@ -16,7 +16,7 @@ from xml.dom.minidom import parse, parseString import Emailer from regression_utils import * -def compile(errore, attachli, parsedin): +def compile(errore, attachli, parsedin, branch): global to global server global subj @@ -37,12 +37,12 @@ def compile(errore, attachli, parsedin): while(redo): passed = True if(passed): - gitPull("sleuthkit") + gitPull("sleuthkit", branch) if(passed): vsBuild() print("TSK") if(passed): - gitPull("autopsy") + gitPull("autopsy", branch) if(passed): antBuild("datamodel", False) print("DataModel") @@ -66,7 +66,7 @@ def compile(errore, attachli, parsedin): passed = True #Pulls from git -def gitPull(TskOrAutopsy): +def gitPull(TskOrAutopsy, branch): global SYS global errorem global attachl @@ -75,7 +75,7 @@ def gitPull(TskOrAutopsy): attachl.append(gppth) gpout = open(gppth, 'a') toPull = "https://www.github.com/sleuthkit/" + TskOrAutopsy - call = ["git", "pull", toPull] + call = ["git", "pull", toPull, branch] if TskOrAutopsy == "sleuthkit": ccwd = os.path.join("..", "..", "..", "sleuthkit") else: @@ -181,6 +181,8 @@ def main(): arg = sys.argv.pop(0) arg = sys.argv.pop(0) config_file = arg + arg = sys.argv.pop(0) + branch = arg parsedin = parse(config_file) try: to = parsedin.getElementsByTagName("email")[0].getAttribute("value").encode().decode("utf_8") @@ -190,7 +192,7 @@ def main(): email_enabled = False # email_enabled = (to is not None) and (server is not None) and (subj is not None) email_enabled = False - compile(errore, attachli, parsedin) + compile(errore, attachli, parsedin, branch) class OS: LINUX, MAC, WIN, CYGWIN = range(4)