Changeset 10623:2c440c34c248 in orange


Ignore:
Timestamp:
03/23/12 17:21:06 (2 years ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Use setup.py to publish the sources and rotate latest versions.

Location:
install-scripts/mac
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • install-scripts/mac/build-source.sh

    r10508 r10623  
    88# $4 work dir 
    99# $5 distribution name 
     10# $6 source and egg distribution dir ($4 by default) 
     11# $7 force 
    1012# 
    1113# Example ./build-source.sh http://bitbucket.org/biolab/orange orange tip /private/tmp/repos Orange 
     
    1618WORK_DIR=$4 
    1719DIST_NAME=$5 
     20DIST_DIR=${6:-$WORK_DIR} 
     21FORCE=$7 
     22 
     23# dist name with '-' replaced 
     24UDIST_NAME=`echo $DIST_NAME | sed s/-/_/g` 
    1825 
    1926LOCAL_REPO=$WORK_DIR/$REPO_DIRNAME 
    2027 
    21 if [ ! -e $LOCAL_REPO ]; then 
    22     hg clone $HG_REPO $LOCAL_REPO 
     28LATEST_REVISION=`hg id $HG_REPO` 
     29 
     30if [ -e $WORK_DIR/$UDIST_NAME.egg-info/PKG-INFO ]; then 
     31    CURRENT_REVISION=`grep "^Version: " $WORK_DIR/$UDIST_NAME.egg-info/PKG-INFO | cut -d "-" -f 3` 
     32else 
     33    CURRENT_REVISION="" 
    2334fi 
    2435 
    25 if hg incoming -R $LOCAL_REPO; then 
    26     hg pull -R $LOCAL_REPO 
     36if [[ $CURRENT_REVISION != $LATEST_REVISION  || $FORCE ]]; then 
     37    BUILD=1 
     38else 
     39    BUILD= 
    2740fi 
     41echo $BUILD 
    2842 
    29 hg update -r $HG_REV -R $LOCAL_REPO 
     43if [ $BUILD ]; then  
     44    if [ ! -e $LOCAL_REPO ]; then 
     45        hg clone $HG_REPO $LOCAL_REPO 
     46    fi 
    3047 
    31 cd $LOCAL_REPO 
     48    if hg incoming -R $LOCAL_REPO; then 
     49        hg pull -R $LOCAL_REPO 
     50    fi 
    3251 
    33 # Remove old sources 
    34 rm -rf dist/ 
     52    hg update -r $HG_REV -R $LOCAL_REPO 
    3553 
    36 # Build the source distribution 
    37 BUILD_TAG=`hg parent --template=".dev-r{rev}-{node|short}"` 
    38 python setup.py egg_info --tag-build=$BUILD_TAG sdist 
     54    cd $LOCAL_REPO 
    3955 
    40 # Copy the source an egg info to workdir 
    41 cp dist/${DIST_NAME}-*.tar.gz $WORK_DIR 
     56    # Remove old sources 
     57    rm -rf dist/ 
    4258 
    43 UDIST_NAME=`echo $DIST_NAME | sed s/-/_/g` 
    44 cp -r  $UDIST_NAME.egg-info $WORK_DIR 
     59    # Build the source distribution 
     60    BUILD_TAG=`hg parent --template=".dev-r{rev}-{node|short}"` 
    4561 
    46 true 
     62    python setup.py egg_info --tag-build=$BUILD_TAG --egg-base=$DIST_DIR sdist --dist-dir=$DIST_DIR 
     63    python setup.py rotate --match=.tar.gz --dist-dir=$DIST_DIR --keep=20 
     64fi 
  • install-scripts/mac/dailyrun-sources.sh

    r10555 r10623  
    1717 
    1818if [ $LOCAL ]; then 
    19     PUBLISH_DIR=$WORK_DIR/download 
    20     mkdir -p $PUBLISH_DIR 
     19    PUBLISH_DIR=$WORK_DIR/download/sources 
    2120else 
    22     PUBLISH_DIR=/Volumes/download 
     21    PUBLISH_DIR=/Volumes/download/sources 
    2322fi 
    2423 
     
    2726fi 
    2827 
     28 
    2929REPO_DIR=$WORK_DIR/repos 
    30  
    31 # Build source packages 
    32 ./build-source.sh https://bitbucket.org/biolab/orange orange tip $REPO_DIR Orange 
    33 ./build-source.sh https://bitbucket.org/biolab/orange-addon-bioinformatics bioinformatics tip $REPO_DIR Orange-Bioinformatics 
    34 ./build-source.sh https://bitbucket.org/biolab/orange-addon-text text tip $REPO_DIR Orange-Text-Mining 
    3530 
    3631defaults write com.apple.desktopservices DSDontWriteNetworkStores true 
     
    4035fi 
    4136 
    42 # Get versions from PKG-INFO files 
    43 ORANGE_VERSION=`grep "^Version:" $REPO_DIR/Orange.egg-info/PKG-INFO | cut -d " " -f 2` 
    44 BIOINFORMATICS_VERSION=`grep "^Version:" $REPO_DIR/Orange_Bioinformatics.egg-info/PKG-INFO | cut -d " " -f 2` 
    45 TEXT_VERSION=`grep "^Version:" $REPO_DIR/Orange_Text_Mining.egg-info/PKG-INFO | cut -d " " -f 2` 
    46  
    47 # Source filenames 
    48 ORANGE_SOURCE="Orange-${ORANGE_VERSION}.tar.gz" 
    49 BIOINFORMATICS_SOURCE="Orange-Bioinformatics-${BIOINFORMATICS_VERSION}.tar.gz" 
    50 TEXT_SOURCE="Orange-Text-Mining-${TEXT_VERSION}.tar.gz" 
    51  
    52 # Get source packages md5 checksum 
    53 ORANGE_SOURCE_MD5=`md5 -q $REPO_DIR/$ORANGE_SOURCE` 
    54 BIOINFORMATICS_SOURCE_MD5=`md5 -q $REPO_DIR/$BIOINFORMATICS_SOURCE` 
    55 TEXT_SOURCE_MD5=`md5 -q $REPO_DIR/$TEXT_SOURCE` 
    56  
    57  
    58 # Base dir for sources 
    59 SOURCES_DIR=$PUBLISH_DIR/sources 
    60  
    61  
    62 # Publish sources 
    63  
    64 if [ ! -e $SOURCES_DIR ]; then 
    65     mkdir -p $SOURCES_DIR 
     37if [ ! -e $PUBLISH_DIR ]; then 
     38    mkdir -p $PUBLISH_DIR 
    6639fi 
    6740 
    68  
    69 if [[ ! -e $SOURCES_DIR/$ORANGE_SOURCE || $FORCE ]]; then 
    70     cp $REPO_DIR/$ORANGE_SOURCE $SOURCES_DIR/$ORANGE_SOURCE 
    71     cp -r $REPO_DIR/Orange.egg-info $SOURCES_DIR/ 
    72     NEW_ORANGE=1 
    73 fi 
    74  
    75 if [[ ! -e $SOURCES_DIR/BIOINFORMATICS_SOURCE || $FORCE ]]; then 
    76     cp $REPO_DIR/$BIOINFORMATICS_SOURCE $SOURCES_DIR/$BIOINFORMATICS_SOURCE 
    77     cp -r $REPO_DIR/Orange_Bioinformatics.egg-info $SOURCES_DIR/ 
    78     NEW_BIOINFORMATICS=1 
    79 fi 
    80  
    81 if [[ ! -e $SOURCES_DIR/TEXT_SOURCE || $FORCE ]]; then 
    82     cp $REPO_DIR/$TEXT_SOURCE $SOURCES_DIR/$TEXT_SOURCE 
    83     cp -r $REPO_DIR/Orange_Text_Mining.egg-info $SOURCES_DIR/ 
    84     NEW_TEXT=1 
    85 fi 
     41# Build source packages 
     42./build-source.sh https://bitbucket.org/biolab/orange orange tip $REPO_DIR Orange $PUBLISH_DIR $FORCE 
     43./build-source.sh https://bitbucket.org/biolab/orange-addon-bioinformatics bioinformatics tip $REPO_DIR Orange-Bioinformatics $PUBLISH_DIR $FORCE 
     44./build-source.sh https://bitbucket.org/biolab/orange-addon-text text tip $REPO_DIR Orange-Text-Mining $PUBLISH_DIR $FORCE 
    8645 
    8746true 
  • install-scripts/mac/dailyrun.sh

    r10622 r10623  
    3232 
    3333 
    34 SOURCE_LOG=$WORK_DIR/sources-daily-build.log 
    35  
    36 ./dailyrun-sources.sh $WORK_DIR $FORCE $LOCAL &> $SOURCE_LOG 
    37 EXIT_VALUE=$? 
    38  
    3934defaults write com.apple.desktopservices DSDontWriteNetworkStores true 
    4035 
     
    4338fi 
    4439 
     40SOURCE_LOG=$WORK_DIR/sources-daily-build.log 
     41 
     42./dailyrun-sources.sh $WORK_DIR $FORCE $LOCAL &> $SOURCE_LOG 
     43EXIT_VALUE=$? 
     44 
    4545echo "Orange (sources) [ $EXIT_VALUE ]" > "$LOG_DIR/source-daily-build-hg.log" 
    4646date >> "$LOG_DIR/source-daily-build-hg.log" 
    4747cat $SOURCE_LOG >> "$LOG_DIR/source-daily-build-hg.log" 
    4848(($EXIT_VALUE)) && echo "Daily sources failed" 
     49 
    4950 
    5051SOURCES_DIR=$PUBLISH_DIR/sources 
     
    6667BIOINFORMATICS_SOURCE_MD5=`md5 -q $SOURCES_DIR/$BIOINFORMATICS_SOURCE` 
    6768TEXT_SOURCE_MD5=`md5 -q $SOURCES_DIR/$TEXT_SOURCE` 
     69 
    6870 
    6971## Daily bundle build from hg (for now always until versioning is established). 
Note: See TracChangeset for help on using the changeset viewer.