source: orange/install-scripts/mac/dailyrun.sh @ 11427:72163d6c657d

Revision 11427:72163d6c657d, 6.7 KB checked in by Ales Erjavec <ales.erjavec@…>, 13 months ago (diff)

Fix for daily build scripts.

  • Property exe set to *
RevLine 
[10702]1#!/bin/bash
[5517]2#
3# Should be run as: sudo ./dailyrun.sh
4#
[10556]5# $1 workdir
6# $2 force
7# $3 local
[5517]8
[10556]9WORK_DIR=${1:-"/private/tmp"}
10FORCE=$2
11LOCAL=$3
[10501]12
[10563]13MAC_VERSION=`sw_vers -productVersion | cut -d '.' -f 2`
14
[8060]15test -r /sw/bin/init.sh && . /sw/bin/init.sh
16
[10345]17export PATH=$HOME/bin:$PATH
18
[10501]19if [ $LOCAL ]; then
[10556]20    PUBLISH_DIR=$WORK_DIR/download
21    LOG_DIR=$WORK_DIR/logs
[10501]22    mkdir -p $PUBLISH_DIR
[10556]23    mkdir -p $LOG_DIR
[5770]24else
[10501]25    PUBLISH_DIR=/Volumes/download
[10556]26    LOG_DIR=/Volumes/download/buildLogs/osx
[5770]27fi
28
[10501]29if [ ! -e $WORK_DIR ]; then
30    mkdir -p $WORK_DIR
31fi
[5770]32
[10870]33SOURCES_DIR=$PUBLISH_DIR/sources
[10501]34
[5695]35defaults write com.apple.desktopservices DSDontWriteNetworkStores true
36
[10501]37if [ ! $LOCAL ]; then
38    /Users/ailabc/mount-dirs.sh || { echo "Mounting failed." ; exit 1 ; }
39fi
[5695]40
[10869]41# Get old source addon versions from PKG-INFO files (these are updated by dailyrun-sources)
42OLD_ORANGE_VERSION=`grep "^Version:" $SOURCES_DIR/Orange.egg-info/PKG-INFO | cut -d " " -f 2`
43OLD_BIOINFORMATICS_VERSION=`grep "^Version:" $SOURCES_DIR/Orange_Bioinformatics.egg-info/PKG-INFO | cut -d " " -f 2`
[10910]44OLD_TEXT_VERSION=`grep "^Version:" $SOURCES_DIR/Orange_Text.egg-info/PKG-INFO | cut -d " " -f 2`
[10869]45
46
[10623]47SOURCE_LOG=$WORK_DIR/sources-daily-build.log
48
49./dailyrun-sources.sh $WORK_DIR $FORCE $LOCAL &> $SOURCE_LOG
50EXIT_VALUE=$?
51
[10556]52echo "Orange (sources) [ $EXIT_VALUE ]" > "$LOG_DIR/source-daily-build-hg.log"
53date >> "$LOG_DIR/source-daily-build-hg.log"
[10563]54cat $SOURCE_LOG >> "$LOG_DIR/source-daily-build-hg.log"
[10556]55(($EXIT_VALUE)) && echo "Daily sources failed"
56
[10623]57
[10869]58# Get new versions from PKG-INFO files (these are updated by dailyrun-sources)
[10556]59ORANGE_VERSION=`grep "^Version:" $SOURCES_DIR/Orange.egg-info/PKG-INFO | cut -d " " -f 2`
60BIOINFORMATICS_VERSION=`grep "^Version:" $SOURCES_DIR/Orange_Bioinformatics.egg-info/PKG-INFO | cut -d " " -f 2`
[10910]61TEXT_VERSION=`grep "^Version:" $SOURCES_DIR/Orange_Text.egg-info/PKG-INFO | cut -d " " -f 2`
[10556]62
63
64# Source filenames
65ORANGE_SOURCE="Orange-${ORANGE_VERSION}.tar.gz"
66BIOINFORMATICS_SOURCE="Orange-Bioinformatics-${BIOINFORMATICS_VERSION}.tar.gz"
[10910]67TEXT_SOURCE="Orange-Text-${TEXT_VERSION}.tar.gz"
[10556]68
69
70# Get source packages md5 checksum
71ORANGE_SOURCE_MD5=`md5 -q $SOURCES_DIR/$ORANGE_SOURCE`
72BIOINFORMATICS_SOURCE_MD5=`md5 -q $SOURCES_DIR/$BIOINFORMATICS_SOURCE`
73TEXT_SOURCE_MD5=`md5 -q $SOURCES_DIR/$TEXT_SOURCE`
74
[10869]75# Are there new versions of orange and addons available.
76if [[ $OLD_ORANGE_VERSION < $ORANGE_VERSION ]]; then
77    NEW_ORANGE=1
78fi
79
80if [[ $OLD_BIOINFORMATICS_VERSION < $BIOINFORMATICS_VERSION ]]; then
81    NEW_BIOINFORMATICS=1
82    NEW_BUNDLE_ADDONS=1
83fi
84
85if [[ $OLD_TEXT_VERSION < $TEXT_VERSION ]]; then
86    NEW_TEXT=1
87    NEW_BUNDLE_ADDONS=1
88fi
[10623]89
[10556]90## Daily bundle build from hg (for now always until versioning is established).
91if [[ true || $NEW_ORANGE || $NEW_BIOINFORMATICS || $NEW_TEXT || $FORCE ]]; then
[11427]92    ./bundle-daily-build-hg.sh "$WORK_DIR" "$PUBLISH_DIR" $NEW_BUNDLE_ADDONS &> $WORK_DIR/bundle-daily-build.log
[10556]93    EXIT_VALUE=$?
94fi
95
96if [ ! $LOCAL ]; then
97    /Users/ailabc/mount-dirs.sh || { echo "Mounting failed." ; exit 1 ; }
98fi
99
[10563]100echo "Orange (bundle $MAC_VERSION from hg) [$EXIT_VALUE]" > "$LOG_DIR/bundle-$MAC_VERSION-daily-build-hg.log"
101date >> "$LOG_DIR/bundle-$MAC_VERSION-daily-build-hg.log"
102cat $WORK_DIR/bundle-daily-build.log >> "$LOG_DIR/bundle-$MAC_VERSION-daily-build-hg.log"
[10556]103(($EXIT_VALUE)) && echo "Running bundle-daily-build-hg.sh failed"
104
105
106MAC_VERSION=`sw_vers -productVersion | cut -d '.' -f 2`
107ARCH=`perl -MFink::FinkVersion -e 'print Fink::FinkVersion::get_arch'`
108
109FINK_ROOT=/sw
110
111if [ ! $LOCAL ]; then
112    # Compare with the published info files
113    BASE="http://orange.biolab.si/fink/dists/$ARCH/main/finkinfo"
114else
115    # Compare with the local info files
116    BASE="file://$FINK_ROOT/fink/dists/local/main/finkinfo"
117fi
118
119
[10622]120OLD_ORANGE_VERSION=`curl --silent $BASE/orange-gui-dev-py.info | grep "Version: " | cut -d" " -f 2`
121OLD_BIOINFORMATICS_VERSION=`curl --silent $BASE/orange-bioinformatics-gui-dev-py.info | grep "Version: " | cut -d" " -f 2`
122OLD_TEXT_VERSION=`curl --silent $BASE/orange-text-gui-dev-py.info | grep "Version: " | cut -d" " -f 2`
[10556]123
[10869]124if [[ $OLD_ORANGE_VERSION < $ORANGE_VERSION ]]; then
[10556]125    NEW_ORANGE=1
126fi
127
[10869]128if [[ $OLD_BIOINFORMATICS_VERSION < $BIOINFORMATICS_VERSION ]]; then
[10556]129    NEW_BIOINFORMATICS=1
130fi
131
[10869]132if [[ $OLD_TEXT_VERSION < $TEXT_VERSION ]]; then
[10556]133    NEW_TEXT=1
134fi
135
136
137# Base url for sources in fink .info files
[10501]138if [ $LOCAL ]; then
139    BASE_URL="file://$PUBLISH_DIR/sources"
140else
141    BASE_URL="http://orange.biolab.si/download/sources"
142fi
[10272]143
[10501]144# Update the local finkinfo
[10556]145# Local info files will be moved to biolab/main/finkinfo in fink-daily-build-packages.sh
[10501]146FINK_INFO_DIR="$FINK_ROOT/fink/dists/local/main/finkinfo"
147
148if [ ! -e $FINK_INFO_DIR ]; then
149    mkdir -p $FINK_INFO_DIR
150fi
151
[10702]152# Remove any old remaining local .info files
153rm -f $FINK_INFO_DIR/orange-*.info
154
[10501]155# Directory where fink .info templates are
156FINK_TEMPLATES=$WORK_DIR/orange/install-scripts/mac/fink
157
[10556]158FINK_LOG=$WORK_DIR/fink-daily-build.log
[10527]159echo "" > $FINK_LOG
160
[10501]161if [[ $NEW_ORANGE || $FORCE ]]; then
162    FINK_ORANGE_SOURCE_TEMPLATE="Orange-%v.tar.gz"
[10622]163    ./fink-register-info.sh "$FINK_TEMPLATES/orange-gui-dev-py.info" $BASE_URL/$FINK_ORANGE_SOURCE_TEMPLATE $ORANGE_SOURCE_MD5 $ORANGE_VERSION $FINK_INFO_DIR/orange-gui-dev-py.info >> $FINK_LOG 2>&1
[10702]164    FINK_ORANGE_INFO_EXIT_VALUE=$?
[10501]165fi
166
167if [[ $NEW_BIOINFORMATICS || $FORCE ]]; then
168    FINK_BIOINFORMATICS_SOURCE_TEMPLATE="Orange-Bioinformatics-%v.tar.gz"
[10622]169    ./fink-register-info.sh "$FINK_TEMPLATES/orange-bioinformatics-gui-dev-py.info" $BASE_URL/$FINK_BIOINFORMATICS_SOURCE_TEMPLATE $BIOINFORMATICS_SOURCE_MD5 $BIOINFORMATICS_VERSION $FINK_INFO_DIR/orange-bioinformatics-gui-dev-py.info >> $FINK_LOG 2>&1
[10702]170    FINK_BIOINFORMATICS_INFO_EXIT_VALUE=$?
[10501]171fi
172
173if [[ $NEW_TEXT || $FORCE ]]; then
[10910]174    FINK_TEXT_SOURCE_TEMPLATE="Orange-Text-%v.tar.gz"
[10622]175    ./fink-register-info.sh "$FINK_TEMPLATES/orange-text-gui-dev-py.info" $BASE_URL/$FINK_TEXT_SOURCE_TEMPLATE $TEXT_SOURCE_MD5 $TEXT_VERSION $FINK_INFO_DIR/orange-text-gui-dev-py.info >> $FINK_LOG 2>&1
[10702]176    FINK_TEXT_INFO_EXIT_VALUE=$?
[10501]177fi
178
179if [ ! $LOCAL ]; then
180    /Users/ailabc/mount-dirs.sh || { echo "Mounting failed." ; exit 1 ; }
181fi
182
[10702]183EXIT_VALUE=$(($FINK_ORANGE_INFO_EXIT_VALUE + $FINK_BIOINFORMATICS_INFO_EXIT_VALUE + $FINK_TEXT_INFO_EXIT_VALUE))
184if (($EXIT_VALUE)); then
185    echo "Running fink-register-info.sh failed"
186    rm -f $FINK_INFO_DIR/orange-*.info
187fi
[10501]188
189## daily fink build
[7694]190
[10556]191./fink-daily-build-packages.sh &> $WORK_DIR/fink-daily-build-packages.log
[6043]192EXIT_VALUE=$?
[7694]193
[10501]194if [ ! $LOCAL ]; then
195    /Users/ailabc/mount-dirs.sh || { echo "Mounting failed." ; exit 1 ; }
196fi
[7694]197
[10563]198echo "Orange (fink $MAC_VERSION $ARCH) [$EXIT_VALUE]" > "$LOG_DIR/fink-$MAC_VERSION-$ARCH-daily-build.log"
199date >> "$LOG_DIR/fink-$MAC_VERSION-$ARCH-daily-build.log"
200cat $WORK_DIR/fink-daily-build-packages.log >> "$LOG_DIR/fink-$MAC_VERSION-$ARCH-daily-build.log"
[6043]201(($EXIT_VALUE)) && echo "Running fink-daily-build.sh failed"
[6056]202
203# Zero exit value
204true
Note: See TracBrowser for help on using the repository browser.