[Commits] (heikki) We don't need distchandler.py script, since the normal build scripts can do that job fine. This also fixes bug 1823, where debug milestone distribution did not launch because of a missing DLL.

commits at osafoundation.org commits at osafoundation.org
Thu Sep 2 19:58:09 PDT 2004


Commit by: heikki
Modified files:
hardhat/singlebuild.py 1.9 1.10
hardhat/buildscripts/fullchandler.py 1.9 1.10
hardhat/buildscripts/newchandler.py 1.38 1.39
hardhat/buildscripts/distchandler.py 1.1 None

Log message:
We don't need distchandler.py script, since the normal build scripts can do that job fine. This also fixes bug 1823, where debug milestone distribution did not launch because of a missing DLL.

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/hardhat/singlebuild.py.diff?r1=text&tr1=1.9&r2=text&tr2=1.10
http://cvs.osafoundation.org/index.cgi/hardhat/buildscripts/fullchandler.py.diff?r1=text&tr1=1.9&r2=text&tr2=1.10
http://cvs.osafoundation.org/index.cgi/hardhat/buildscripts/newchandler.py.diff?r1=text&tr1=1.38&r2=text&tr2=1.39
http://cvs.osafoundation.org/index.cgi/hardhat/buildscripts/distchandler.py.diff?r1=text&tr1=1.1&r2=text&tr2=None

Index: hardhat/singlebuild.py
diff -u hardhat/singlebuild.py:1.9 hardhat/singlebuild.py:1.10
--- hardhat/singlebuild.py:1.9	Tue May 18 13:37:01 2004
+++ hardhat/singlebuild.py	Thu Sep  2 19:58:08 2004
@@ -10,19 +10,28 @@
 
 import hardhatutil, time, smtplib, os, sys, getopt
 
-# args:  toAddr, buildName, project, vintage
+project = 'newchandler'
+
+
 def usage():
+    global project
+    
     print "python singlebuild.py [OPTION]..."
     print ""
     print "-b BUILDVER    string to put into the buildversion encoded in app"
     print "-d DATE        date to use for CVS checkout"
-    print "-m MAILTO      who to email when build is finished"
-    print "-p PROJECT     name of project, must have a buildscript"
     print "-t TAG         tag to use for CVS checkout"
+    print "-p PROJECT     buildscript, defaults to ", project
+    print "-m MAILTO      who to email when build is finished (optional)"
+    print "-n BUILDNAME   buildname (optional)"
+    print "-s             if specified, skip tests (optional)"    
+    print "\nFor example:"
+    print "  python singlebuild.py -t CHANDLER_0_3_23"    
 
 
 def main():
-
+    global project
+    
     nowString = time.strftime("%Y-%m-%d %H:%M:%S")
     nowShort = hardhatutil.RemovePunctuation(nowString)
     # nowString is the current time, in a CVS-compatible format
@@ -31,7 +40,7 @@
     print nowShort
 
     try:
-        opts, args = getopt.getopt(sys.argv[1:], "b:d:m:p:t:")
+        opts, args = getopt.getopt(sys.argv[1:], "b:d:m:p:t:n:s")
     except getopt.GetoptError:
         usage()
         sys.exit(1)
@@ -41,6 +50,8 @@
     toAddrArg = None
     projectArg = None
     cvsTagArg = None
+    buildName = 'buildname'
+    noTests = 0
 
     for opt, arg in opts:
 
@@ -59,21 +70,25 @@
         if opt == "-t":
             cvsTagArg = arg
 
+        if opt == "-n":
+            buildName = arg
+
+        if opt == "-s":
+            noTests = 1
+
     if cvsDateArg and cvsTagArg:
         print "Please choose either a cvs date or tag, not both"
         sys.exit(1)
 
     # defaults:
-    if projectArg is None:
-        project = "chandler"
-    else:
+    if projectArg:
         project = projectArg
         
-    if toAddrArg is None:
-        toAddr  = "morgen at osafoundation.org"
-    else:
+    if toAddrArg:
         toAddr  = toAddrArg
-        
+    else:
+        toAddr = None
+
     buildVersion = nowString
 
     # default is "-D now", but override with date; override that with tag
@@ -91,6 +106,8 @@
     print "nowShort", nowShort
     print "cvsVintage", cvsVintage
     print "buildVersion", buildVersion
+    print "buildName", buildName
+    print "skipTests=", noTests
 
     # cvsVintage is what is used to do a checkout
     # buildVersion is encoded into the application's internal version
@@ -102,7 +119,9 @@
     buildDir = os.path.join(homeDir, "singlebuild")
     logFile = os.path.join(buildDir, "build.log")
     buildscriptFile = os.path.join("buildscripts", project + ".py")
-    fromAddr = "builds at osafoundation.org"
+    fromAddr = "builds"
+    fromAddr += "@"
+    fromAddr += "osafoundation.org"
     print "Mail to ", toAddr
     print "Build dir", buildDir
     print "Build file ", buildscriptFile
@@ -120,18 +139,20 @@
     try:
         # bring this hardhat directory up to date
         outputList = hardhatutil.executeCommandReturnOutputRetry(
-         [cvsProgram, "update", cvsVintage])
+         [cvsProgram, "-z3", "update", "-dP", cvsVintage])
 
         # load the buildscript file for the project
         mod = hardhatutil.ModuleFromFile(buildscriptFile, "buildscript")
 
-        # SendMail(fromAddr, toAddr, startTime, buildName, "building", 
-        #  treeName, None)
+        # SendMail(fromAddr, toAddr, nowString, nowString, buildName,
+        # "building", None)
 
-        mod.Start(hardhatFile, buildDir, cvsVintage, buildVersion, 1, log)
+        mod.Start(hardhatFile, buildDir, cvsVintage, buildVersion, 1, log,
+                  skipTests=noTests)
 
     except Exception, e:
-        print e
+        import traceback
+        traceback.print_exc()
         print "something failed"
         log.write("something failed")
         status = "build_failed"
@@ -144,15 +165,16 @@
     log = open(logFile, "r")
     logContents = log.read()
     log.close()
-    nowTime = str(int(time.time()))
 
-    # SendMail(fromAddr, toAddr, startTime, buildName, status, treeName, 
-    # logContents)
+    if toAddr:
+        SendMail(fromAddr, toAddr, nowString, buildName, status, logContents)
+
 
-def SendMail(fromAddr, toAddr, startTime, buildName, status, treeName, logContents):
+def SendMail(fromAddr, toAddr, startTime, buildName, status, logContents):
     nowTime  = str(int(time.time()))
-    msg      = ("From: %s\r\nTo: %s\r\n\r\n" % (fromAddr, toAddr))
-    msg      = msg + "tinderbox: tree: " + treeName + "\n"
+    subject  = "[singlebuild] " + status + " from " + buildName
+    msg      = ("From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" % (fromAddr, toAddr, subject))
+    msg      = msg + "tinderbox: tree: Chandler\n"
     msg      = msg + "tinderbox: buildname: " + buildName + "\n"
     msg      = msg + "tinderbox: starttime: " + startTime + "\n"
     msg      = msg + "tinderbox: timenow: " + nowTime + "\n"
@@ -167,4 +189,5 @@
     server.sendmail(fromAddr, toAddr, msg)
     server.quit()
 
+
 main()

Index: hardhat/buildscripts/fullchandler.py
diff -u hardhat/buildscripts/fullchandler.py:1.9 hardhat/buildscripts/fullchandler.py:1.10
--- hardhat/buildscripts/fullchandler.py:1.9	Wed Sep  1 17:29:22 2004
+++ hardhat/buildscripts/fullchandler.py	Thu Sep  2 19:58:08 2004
@@ -24,7 +24,7 @@
     'external', 'internal', 'chandler',
 )
 
-def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log):
+def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log, skipTests=False):
 
     global buildenv, changes
 
@@ -100,11 +100,14 @@
         for releaseMode in ('release', 'debug'):
             doDistribution(releaseMode, workingDir, log, outputDir, buildVersion, buildVersionEscaped, hardhatScript)
 
-        for releaseMode in ('release', 'debug'):
-            ret = doTests(hardhatScript, releaseMode, workingDir, outputDir, 
-              cvsVintage, buildVersion, log)
-            if ret != 'success':
-                break
+        if skipTests:
+            ret = 'success'
+        else:
+            for releaseMode in ('release', 'debug'):
+                ret = doTests(hardhatScript, releaseMode, workingDir,
+                              outputDir, cvsVintage, buildVersion, log)
+                if ret != 'success':
+                    break
 
         changes = "-first-run"
     else:
@@ -130,11 +133,14 @@
             changes = "-nochanges"
 
         # do tests
-        for releaseMode in ('debug', 'release'):   
-            ret = doTests(hardhatScript, releaseMode, workingDir, outputDir, 
-              cvsVintage, buildVersion, log)
-            if ret != 'success':
-                break
+        if skipTests:
+            ret = 'success'
+        else:
+            for releaseMode in ('debug', 'release'):   
+                ret = doTests(hardhatScript, releaseMode, workingDir,
+                              outputDir, cvsVintage, buildVersion, log)
+                if ret != 'success':
+                    break
 
     return ret + changes 
 

Index: hardhat/buildscripts/newchandler.py
diff -u hardhat/buildscripts/newchandler.py:1.38 hardhat/buildscripts/newchandler.py:1.39
--- hardhat/buildscripts/newchandler.py:1.38	Wed Sep  1 14:40:16 2004
+++ hardhat/buildscripts/newchandler.py	Thu Sep  2 19:58:08 2004
@@ -22,7 +22,7 @@
 logPath = 'hardhat.log'
 separator = "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n"
 
-def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log):
+def Start(hardhatScript, workingDir, cvsVintage, buildVersion, clobber, log, skipTests=False):
 
     global buildenv, changes
 
@@ -92,11 +92,14 @@
             doInstall(releaseMode, workingDir, log)
 
             doDistribution(releaseMode, workingDir, log, outputDir, buildVersion, buildVersionEscaped, hardhatScript)
-            
-            ret = doTests(hardhatScript, releaseMode, workingDir, outputDir, 
-              cvsVintage, buildVersion, log)
-            if ret != 'success':
-                break
+
+            if skipTests:
+                ret = 'success'
+            else:
+                ret = doTests(hardhatScript, releaseMode, workingDir,
+                              outputDir, cvsVintage, buildVersion, log)
+                if ret != 'success':
+                    break
 
         changes = "-first-run"
     else:
@@ -123,11 +126,14 @@
             changes = "-nochanges"
 
         # do tests
-        for releaseMode in ('debug', 'release'):   
-            ret = doTests(hardhatScript, releaseMode, workingDir, outputDir, 
-              cvsVintage, buildVersion, log)
-            if ret != 'success':
-                break
+        if skipTests:
+            ret = 'success'
+        else:
+            for releaseMode in ('debug', 'release'):   
+                ret = doTests(hardhatScript, releaseMode, workingDir,
+                              outputDir, cvsVintage, buildVersion, log)
+                if ret != 'success':
+                    break
 
     return ret + changes 
 



More information about the Commits mailing list