New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 80468


Ignore:
Timestamp:
07/13/11 08:23:45 (4 years ago)
Author:
jmr@…
Message:

buildmaster: update for archive deployment

Location:
contrib/buildbot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • contrib/buildbot/deploy_archives.sh

    r80462 r80468  
    1414fi 
    1515 
    16 # path where it keeps archives 
     16# path where download server keeps archives 
    1717if [[ -z "$DLPATH" ]]; then 
    18     DLPATH="/archives" 
     18    DLPATH="./deployed_archives" 
    1919fi 
    2020 
    21 # path where archives get uploaded to master 
     21# path where archives get uploaded to buildmaster 
    2222if [[ -z "$ULPATH" ]]; then 
    23     ULPATH="${PREFIX}/var/macports/software" 
     23    ULPATH="./archive_staging" 
    2424fi 
    2525 
     
    3030 
    3131 
    32 for portname in `cat $PORTLISTFILE`; do 
    33     if ls logs-*/success/${portname}.log > /dev/null 2>&1 ; then 
    34         if ./mpexport/base/portmgr/jobs/port_binary_distributable.tcl ${portname}; then 
    35             echo $portname is distributable 
    36             portversion=$(${PREFIX}/bin/port info --version --line ${portname}) 
    37             portrevision=$(${PREFIX}/bin/port info --revision --line ${portname}) 
    38             for archive in ${ULPATH}/${portname}/${portname}-${portversion}_${portrevision}[+.]*; do 
    39                 aname=$(basename $archive) 
    40                 echo deploying archive: $aname 
    41                 if [[ -n "$PRIVKEY" ]]; then 
    42                     openssl dgst -ripemd160 -sign "${PRIVKEY}" -out ./${aname}.rmd160 ${archive} 
    43                 fi 
    44                 if [[ -n "$DLHOST" ]]; then 
    45                     ssh ${DLHOST} mkdir -p ${DLPATH}/${portname}; 
    46                     rsync -av --ignore-existing ./${aname}.rmd160 ${archive} ${DLHOST}:${DLPATH}/${portname}; 
    47                 else 
    48                     mkdir -p ${DLPATH}/${portname}; 
    49                     rsync -av --ignore-existing ./${aname}.rmd160 ${archive} ${DLPATH}/${portname}; 
    50                 fi 
    51                 rm -f ./${aname}.rmd160 
    52             done 
    53         else 
    54             echo $portname is not distributable 
    55         fi 
     32for archive in ${ULPATH}/*/*; do 
     33    portname=$(basename $(dirname $archive)) 
     34    aname=$(basename $archive) 
     35    echo deploying archive: $aname 
     36    if [[ -n "$PRIVKEY" ]]; then 
     37        openssl dgst -ripemd160 -sign "${PRIVKEY}" -out ${ULPATH}/${portname}/${aname}.rmd160 ${archive} 
    5638    fi 
    5739done 
     40 
     41if [[ -n "$DLHOST" ]]; then 
     42    rsync -av --ignore-existing ${ULPATH}/ ${DLHOST}:${DLPATH} 
     43else 
     44    rsync -av --ignore-existing ${ULPATH}/ ${DLPATH} 
     45fi 
     46 
     47# clean up after ourselves 
     48rm -rf $ULPATH 
  • contrib/buildbot/master.cfg

    r80457 r80468  
    159159    src_prefix='%(workdir)s/opt/mports' 
    160160    dlhost='' 
    161     dlpath='.' 
     161    dlpath='./deployed_archives' 
    162162 
    163163ports_factory = BuildFactory() 
     
    177177                           'SRC_PREFIX': WithProperties(src_prefix)})) 
    178178 
     179ulpath='archive_staging' 
     180ports_factory.addStep(ShellCommand(command=["./gather_archives.sh"], 
     181                                   name="gather archives", 
     182                                   description="gather distributable archives into one place for upload", 
     183                      env={'PREFIX': WithProperties(prefix), 
     184                           'ULPATH': ulpath})) 
     185# upload archives from build slave to master 
     186from buildbot.steps.transfer import DirectoryUpload 
     187ports_factory.addStep(DirectoryUpload(slavesrc=ulpath, masterdest=ulpath)) 
    179188# sign generated binaries and sync to download server (if distributable) 
    180 ports_factory.addStep(MasterShellCommand(command=["mpab/deploy_archives.sh"], 
     189from buildbot.steps.master import MasterShellCommand 
     190ports_factory.addStep(MasterShellCommand(command=["./deploy_archives.sh"], 
    181191                                   name="deploy archives", 
    182192                                   description="deploy archives", 
    183193                      env={'PREFIX': WithProperties(prefix), 
    184194                           'PRIVKEY': privkey, 
     195                           'ULPATH': ulpath, 
    185196                           'DLHOST': dlhost, 
    186197                           'DLPATH': dlpath})) 
     
    192203                        env={'PREFIX': WithProperties(prefix)}, 
    193204                        logfiles={"portstatus": "portstatus.log"})) 
    194 # do we want to upload the individual logs so maintainers can review them? 
    195 ports_factory.addStep(ShellCommand(command="rm -rf ./logs-*", 
     205# TODO: do we want to upload the individual logs so maintainers can review them? 
     206ports_factory.addStep(ShellCommand(command="rm -rf ./logs-* ./"+ulpath, 
    196207                                   name="cleanup", 
    197208                                   description="cleanup")) 
Note: See TracChangeset for help on using the changeset viewer.