autobuild: added --rebase-master and --push-master
authorAndrew Tridgell <tridge@samba.org>
Sat, 25 Sep 2010 22:53:32 +0000 (15:53 -0700)
committerAndrew Tridgell <tridge@samba.org>
Sun, 26 Sep 2010 01:21:49 +0000 (01:21 +0000)
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

script/autobuild.py
script/commit_mark.sh

index 4a10092bced97b9b3931e3650b518aab4f317e4b..a1b45906a956d7961f3ee1329a2922e956b0fc3d 100755 (executable)
@@ -8,43 +8,53 @@ import os, signal, tarfile, sys, time
 from optparse import OptionParser
 
 
+samba_master = os.getenv('SAMBA_MASTER', 'git://git.samba.org/samba.git')
+samba_master_ssh = os.getenv('SAMBA_MASTER_SSH', 'git+ssh://git.samba.org/data/git/samba.git')
+
 cleanup_list = []
 
 tasks = {
     "source3" : [ "./autogen.sh",
                   "./configure.developer ${PREFIX}",
                   "make basics",
-                  "make -j",
-                  "make test" ],
+                  "make -j 4 everything", # don't use too many processes
+                  "make install",
+                  "TDB_NO_FSYNC=1 make test" ],
 
     "source4" : [ "./autogen.sh",
                   "./configure.developer ${PREFIX}",
                   "make -j",
-                  "make test" ],
+                  "make install",
+                  "TDB_NO_FSYNC=1 make test" ],
 
     "source4/lib/ldb" : [ "./autogen-waf.sh",
                           "./configure --enable-developer -C ${PREFIX}",
                           "make -j",
+                          "make install",
                           "make test" ],
 
     "lib/tdb" : [ "./autogen-waf.sh",
                   "./configure --enable-developer -C ${PREFIX}",
                   "make -j",
+                  "make install",
                   "make test" ],
 
     "lib/talloc" : [ "./autogen-waf.sh",
                      "./configure --enable-developer -C ${PREFIX}",
                      "make -j",
+                     "make install",
                      "make test" ],
 
     "lib/replace" : [ "./autogen-waf.sh",
                       "./configure --enable-developer -C ${PREFIX}",
                       "make -j",
+                      "make install",
                       "make test" ],
 
     "lib/tevent" : [ "./autogen-waf.sh",
                      "./configure --enable-developer -C ${PREFIX}",
                      "make -j",
+                     "make install",
                      "make test" ],
 }
 
@@ -226,8 +236,12 @@ parser.add_option("", "--verbose", help="show all commands as they are run",
                   default=False, action="store_true")
 parser.add_option("", "--rebase", help="rebase on the given tree before testing",
                   default=None, type='str')
+parser.add_option("", "--rebase-master", help="rebase on %s before testing" % samba_master,
+                  default=False, action='store_true')
 parser.add_option("", "--pushto", help="push to a git url on success",
                   default=None, type='str')
+parser.add_option("", "--push-master", help="push to %s on success" % samba_master_ssh,
+                  default=False, action='store_true')
 parser.add_option("", "--mark", help="add a Tested-By signoff before pushing",
                   default=False, action="store_true")
 
@@ -258,6 +272,8 @@ except:
 try:
     if options.rebase is not None:
         rebase_tree(options.rebase)
+    elif options.rebase_master:
+        rebase_tree(samba_master)
     blist = buildlist(tasks, args)
     if options.tail:
         blist.start_tail()
@@ -278,6 +294,8 @@ if status == 0:
         run_cmd(options.passcmd, dir=test_master)
     if options.pushto is not None:
         push_to(options.pushto)
+    elif options.push_master:
+        push_to(samba_master_ssh)
     if options.keeplogs:
         blist.tarlogs("logs.tar.gz")
         print("Logs in logs.tar.gz")
index 38328c48271aefb799d259b97765109f100d6b46..bb1e9428a04c56f5644d75d2300426c6a4db5bea 100755 (executable)
@@ -1,6 +1,11 @@
 #!/bin/sh
 # add a autobuild message to the HEAD commit
 
+if grep -q '^Autobuild.User' "$1"; then
+    echo "Already marked as tested"
+    exit 0
+fi
+
 fullname=$(getent passwd $USER | cut -d: -f5| cut -d',' -f1)
 cat <<EOF >> "$1"
 Autobuild-User: $fullname <$USER@samba.org>