[80468] contrib/buildbot

jmr at macports.org jmr at macports.org
Wed Jul 13 08:23:46 PDT 2011


Revision: 80468
          http://trac.macports.org/changeset/80468
Author:   jmr at macports.org
Date:     2011-07-13 08:23:45 -0700 (Wed, 13 Jul 2011)
Log Message:
-----------
buildmaster: update for archive deployment

Modified Paths:
--------------
    contrib/buildbot/deploy_archives.sh
    contrib/buildbot/master.cfg

Modified: contrib/buildbot/deploy_archives.sh
===================================================================
--- contrib/buildbot/deploy_archives.sh	2011-07-13 15:14:11 UTC (rev 80467)
+++ contrib/buildbot/deploy_archives.sh	2011-07-13 15:23:45 UTC (rev 80468)
@@ -13,14 +13,14 @@
     DLHOST=""
 fi
 
-# path where it keeps archives
+# path where download server keeps archives
 if [[ -z "$DLPATH" ]]; then
-    DLPATH="/archives"
+    DLPATH="./deployed_archives"
 fi
 
-# path where archives get uploaded to master
+# path where archives get uploaded to buildmaster
 if [[ -z "$ULPATH" ]]; then
-    ULPATH="${PREFIX}/var/macports/software"
+    ULPATH="./archive_staging"
 fi
 
 # private key to use for signing
@@ -29,29 +29,20 @@
 fi
 
 
-for portname in `cat $PORTLISTFILE`; do
-    if ls logs-*/success/${portname}.log > /dev/null 2>&1 ; then
-        if ./mpexport/base/portmgr/jobs/port_binary_distributable.tcl ${portname}; then
-            echo $portname is distributable
-            portversion=$(${PREFIX}/bin/port info --version --line ${portname})
-            portrevision=$(${PREFIX}/bin/port info --revision --line ${portname})
-            for archive in ${ULPATH}/${portname}/${portname}-${portversion}_${portrevision}[+.]*; do
-                aname=$(basename $archive)
-                echo deploying archive: $aname
-                if [[ -n "$PRIVKEY" ]]; then
-                    openssl dgst -ripemd160 -sign "${PRIVKEY}" -out ./${aname}.rmd160 ${archive}
-                fi
-                if [[ -n "$DLHOST" ]]; then
-                    ssh ${DLHOST} mkdir -p ${DLPATH}/${portname};
-                    rsync -av --ignore-existing ./${aname}.rmd160 ${archive} ${DLHOST}:${DLPATH}/${portname};
-		else
-                    mkdir -p ${DLPATH}/${portname};
-                    rsync -av --ignore-existing ./${aname}.rmd160 ${archive} ${DLPATH}/${portname};
-                fi
-                rm -f ./${aname}.rmd160
-            done
-        else
-            echo $portname is not distributable
-        fi
+for archive in ${ULPATH}/*/*; do
+    portname=$(basename $(dirname $archive))
+    aname=$(basename $archive)
+    echo deploying archive: $aname
+    if [[ -n "$PRIVKEY" ]]; then
+        openssl dgst -ripemd160 -sign "${PRIVKEY}" -out ${ULPATH}/${portname}/${aname}.rmd160 ${archive}
     fi
 done
+
+if [[ -n "$DLHOST" ]]; then
+    rsync -av --ignore-existing ${ULPATH}/ ${DLHOST}:${DLPATH}
+else
+    rsync -av --ignore-existing ${ULPATH}/ ${DLPATH}
+fi
+
+# clean up after ourselves
+rm -rf $ULPATH

Modified: contrib/buildbot/master.cfg
===================================================================
--- contrib/buildbot/master.cfg	2011-07-13 15:14:11 UTC (rev 80467)
+++ contrib/buildbot/master.cfg	2011-07-13 15:23:45 UTC (rev 80468)
@@ -158,7 +158,7 @@
     prefix='%(workdir)s/opt/local'
     src_prefix='%(workdir)s/opt/mports'
     dlhost=''
-    dlpath='.'
+    dlpath='./deployed_archives'
 
 ports_factory = BuildFactory()
 # get MPAB itself; we'll do the checkout of base and dports via MPAB's script
@@ -176,12 +176,23 @@
                       env={'PREFIX': WithProperties(prefix),
                            'SRC_PREFIX': WithProperties(src_prefix)}))
 
+ulpath='archive_staging'
+ports_factory.addStep(ShellCommand(command=["./gather_archives.sh"],
+                                   name="gather archives",
+                                   description="gather distributable archives into one place for upload",
+                      env={'PREFIX': WithProperties(prefix),
+                           'ULPATH': ulpath}))
+# upload archives from build slave to master
+from buildbot.steps.transfer import DirectoryUpload
+ports_factory.addStep(DirectoryUpload(slavesrc=ulpath, masterdest=ulpath))
 # sign generated binaries and sync to download server (if distributable)
-ports_factory.addStep(MasterShellCommand(command=["mpab/deploy_archives.sh"],
+from buildbot.steps.master import MasterShellCommand
+ports_factory.addStep(MasterShellCommand(command=["./deploy_archives.sh"],
                                    name="deploy archives",
                                    description="deploy archives",
                       env={'PREFIX': WithProperties(prefix),
                            'PRIVKEY': privkey,
+                           'ULPATH': ulpath,
                            'DLHOST': dlhost,
                            'DLPATH': dlpath}))
 
@@ -191,8 +202,8 @@
                                    description="status",
                         env={'PREFIX': WithProperties(prefix)},
                         logfiles={"portstatus": "portstatus.log"}))
-# do we want to upload the individual logs so maintainers can review them?
-ports_factory.addStep(ShellCommand(command="rm -rf ./logs-*",
+# TODO: do we want to upload the individual logs so maintainers can review them?
+ports_factory.addStep(ShellCommand(command="rm -rf ./logs-* ./"+ulpath,
                                    name="cleanup",
                                    description="cleanup"))
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110713/97163cbe/attachment.html>


More information about the macports-changes mailing list