source: orange/install-scripts/mac/dailyrun.sh @ 10556:f9d69e88bc23

Revision 10556:f9d69e88bc23, 5.6 KB checked in by Ales Erjavec <ales.erjavec@…>, 2 years ago (diff)

Updated dailyrun scripts.

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