source: orange/install-scripts/mac/dailyrun.sh @ 10527:ec46b532bca1

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

Redirect output to log files.

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