source: orange/install-scripts/mac/dailyrun.sh @ 10501:24030273b4b6

Revision 10501:24030273b4b6, 5.0 KB checked in by Ales Erjavec <ales.erjavec@…>, 2 years ago (diff)

Updated dailyrun script.

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