comparison scripts/build_pd_heavy.sh @ 511:633ade85e798 prerelease

Cleared build_pd_heavy
author Giulio Moro <giuliomoro@yahoo.it>
date Wed, 22 Jun 2016 04:53:06 +0100
parents 85ba865d3845
children 42f6af3a5f1d
comparison
equal deleted inserted replaced
510:85ba865d3845 511:633ade85e798
10 pdpath="" 10 pdpath=""
11 NO_UPLOAD="0" 11 NO_UPLOAD="0"
12 WATCH="0" 12 WATCH="0"
13 FORCE="0" 13 FORCE="0"
14 #make sure the paths have the trailing / . 14 #make sure the paths have the trailing / .
15 projectpath="../tmp/heavy/hvtemp/"
16 BBB_DEFAULT_PROJECT_NAME="heavyProject" 15 BBB_DEFAULT_PROJECT_NAME="heavyProject"
17 COMMAND_ARGS= 16 COMMAND_ARGS=
18 RUN_PROJECT=1 17 RUN_PROJECT=1
19 RUN_IN_FOREGROUND=0 18 RUN_IN_FOREGROUND=0
20 RUN_WITHOUT_SCREEN=1 19 RUN_WITHOUT_SCREEN=1
22 21
23 SCRIPTDIR=$(dirname "$0") 22 SCRIPTDIR=$(dirname "$0")
24 [ -z $SCRIPTDIR ] && SCRIPTDIR="./" || SCRIPTDIR=$SCRIPTDIR/ 23 [ -z $SCRIPTDIR ] && SCRIPTDIR="./" || SCRIPTDIR=$SCRIPTDIR/
25 [ -z $HVRESOURCES_DIR ] && HVRESOURCES_DIR=$SCRIPTDIR/hvresources/ 24 [ -z $HVRESOURCES_DIR ] && HVRESOURCES_DIR=$SCRIPTDIR/hvresources/
26 . $SCRIPTDIR.bela_common || { echo "You must be in Bela/scripts to run these scripts" | exit 1; } 25 . $SCRIPTDIR.bela_common || { echo "You must be in Bela/scripts to run these scripts" | exit 1; }
26
27 projectpath="$SCRIPTDIR/../tmp/heavy/hvtemp/"
27 28
28 if [ -z "$BELA_PYTHON27" ]; then 29 if [ -z "$BELA_PYTHON27" ]; then
29 for PY in python python2.7 ; do 30 for PY in python python2.7 ; do
30 python --version 2>&1 | grep "2\.7" >/dev/null 2>&1 31 python --version 2>&1 | grep "2\.7" >/dev/null 2>&1
31 if [ $? -eq 0 ]; then 32 if [ $? -eq 0 ]; then
176 echo "Building project..." 177 echo "Building project..."
177 ssh $BBB_ADDRESS "$MAKE_COMMAND" 178 ssh $BBB_ADDRESS "$MAKE_COMMAND"
178 else 179 else
179 echo "Building and running project..." 180 echo "Building and running project..."
180 if [ $WATCH -eq 1 ] 181 if [ $WATCH -eq 1 ]
181 then 182 then
182 # try to emulate run_without_screen: run with fifo 183 # try to emulate run_without_screen: run with fifo
183 if [ $RUN_WITHOUT_SCREEN -eq 1 ]; 184 if [ $RUN_WITHOUT_SCREEN -eq 1 ];
184 then 185 then
185 ssh $BBB_ADDRESS "$MAKE_COMMAND runscreenfifo" & BACKGROUND_PROCESS_PID=$! 186 ssh $BBB_ADDRESS "$MAKE_COMMAND runscreenfifo" & BACKGROUND_PROCESS_PID=$!
186 # run this in the background, it will be killed anyhow when the process stops. 187 # run this in the background, it will be killed anyhow when the process stops.
187 # Either with the trap below or in another way 188 # Either with the trap below or in another way
188 trap "kill $BACKGROUND_PROCESS_PID; exit 0;" 2 9 189 trap "kill $BACKGROUND_PROCESS_PID; exit 0;" 2 9
189 # add the line below to the trap if you want to kill the process on the board when you exit the script 190 # add the line below to the trap if you want to kill the process on the board when you exit the script
190 # ssh -o ConnectTimeout 2 $BBB_ADDRESS make --no-print-directory -C $BBB_BELA_HOME stop ; 191 # ssh -o ConnectTimeout 2 $BBB_ADDRESS make --no-print-directory -C $BBB_BELA_HOME stop ;
191 else 192 else
192 ssh $BBB_ADDRESS "$MAKE_COMMAND runscreen" 193 ssh $BBB_ADDRESS "$MAKE_COMMAND runscreen"
193 fi 194 fi
194 elif [ $RUN_WITHOUT_SCREEN -eq 1 ] 195 elif [ $RUN_WITHOUT_SCREEN -eq 1 ]
195 then 196 then
196 ssh -t $BBB_ADDRESS "$MAKE_COMMAND run" 197 ssh -t $BBB_ADDRESS "$MAKE_COMMAND run"
197 elif [ $RUN_IN_FOREGROUND -eq 1 ] 198 elif [ $RUN_IN_FOREGROUND -eq 1 ]
198 then 199 then
199 # Run in screen without detaching 200 # Run in screen without detaching
200 ssh -t $BBB_ADDRESS "$MAKE_COMMAND runscreenfg" 201 ssh -t $BBB_ADDRESS "$MAKE_COMMAND runscreenfg"
201 else 202 else
202 # Run in screen and detach 203 # Run in screen and detach
203 ssh $BBB_ADDRESS "$MAKE_COMMAND runscreen" 204 ssh $BBB_ADDRESS "$MAKE_COMMAND runscreen"
204 fi 205 fi
205 fi 206 fi
206 } #uploadBuildRun 207 } #uploadBuildRun
207 208
208 uploadBuildRun 209 uploadBuildRun
209 210
221 folder_has_changed "$pdpath" "$reference_time_file" && { 222 folder_has_changed "$pdpath" "$reference_time_file" && {
222 echo "Content of $pdpath has changed" 223 echo "Content of $pdpath has changed"
223 break 224 break
224 } 225 }
225 folder_has_changed "$HVRESOURCES_DIR" "$reference_time_file" && { 226 folder_has_changed "$HVRESOURCES_DIR" "$reference_time_file" && {
226 echo "Content of $pdpath has changed" 227 echo "Content of "$HVRESOURCES_DIR" has changed"
227 break 228 break
228 } 229 }
229 done 230 done
230 echo "Files changed" 231 echo "Files changed"
231 # if .pd files did not change, no point in re-uploading 232 # if .pd files did not change, no point in re-uploading