source: orange/install-scripts/mac/dailyrun.sh @ 10534:70534adf6275

Revision 10534:70534adf6275, 5.7 KB checked in by Ales Erjavec <ales.erjavec@…>, 2 years ago (diff)

Mount volumes before publishing the log for the source build.

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