comparison scripts/build_pd_heavy.sh @ 549:ff0e9e827dcd prerelease

Updated uploader.py and build_pd_heavy for a more graceful failure
author Giulio Moro <giuliomoro@yahoo.it>
date Fri, 24 Jun 2016 12:42:48 +0100
parents c301cc07ae11
children
comparison
equal deleted inserted replaced
548:3980b707634d 549:ff0e9e827dcd
124 124
125 # These files will be cleared from $projectpath before calling uploader.py 125 # These files will be cleared from $projectpath before calling uploader.py
126 #TODO: get a reliable, exhaustive, up-to-date list. 126 #TODO: get a reliable, exhaustive, up-to-date list.
127 HEAVY_FILES='Heavy* Hv*' 127 HEAVY_FILES='Heavy* Hv*'
128 128
129 check_board_alive
129 set_date 130 set_date
130 reference_time_file="$projectpath"/ 131 reference_time_file="$projectpath"/
131 132
132 uploadBuildRun(){ 133 uploadBuildRun(){
133 if [ $NO_UPLOAD -eq 0 ]; then 134 if [ $NO_UPLOAD -eq 0 ]; then
134 # remove old static files to avoid obsolete errors 135 # remove old static files to avoid obsolete errors
135 # make sure the path is not empty, so avoiding to rm -rf / by mistake 136 # make sure the path is not empty, so avoiding to rm -rf / by mistake
136 [ -z $projectpath ] && { echo 'ERROR: $projectpath is empty.'; exit 0; } 137 [ -z $projectpath ] && { echo 'ERROR: $projectpath is empty.'; exit 0; }
137 # use -rf to prevent warnings in case they do not exist 138 # use -rf to prevent warnings in case they do not exist
138 for file in $HEAVY_FILES 139 for file in $HEAVY_FILES
139 do 140 do
140 rm -rf "$projectpath"/$file 141 rm -rf "$projectpath"/$file
141 done 142 done
143
144 echo "Invoking the online compiler..."
142 # invoke the online compiler 145 # invoke the online compiler
143 "$BELA_PYTHON27" $HVRESOURCES_DIR/uploader.py "$pdpath"/ -n $ENZIENAUDIO_COM_PATCH_NAME -g c -o "$projectpath" $RELEASE_STRING ||\ 146 "$BELA_PYTHON27" $HVRESOURCES_DIR/uploader.py "$pdpath"/ -n $ENZIENAUDIO_COM_PATCH_NAME -g c -o "$projectpath" $RELEASE_STRING ||\
144 { echo "ERROR: an error occurred while executing the uploader.py script"; exit 1; } 147 { echo "ERROR: an error occurred while executing the uploader.py script"; exit $?; }
145 fi; 148 fi;
146 149
147 echo ""; 150 echo "";
148 151
149 # Test that files have been retrieved from the online compiler. 152 # Test that files have been retrieved from the online compiler.
150 # TODO: find a more reliable way of doing this. e.g.: have uploader.py fail with a non-zero error code. 153 # TODO: skip this now that uplodaer.py returns meaningful exit codes
151 for file in $HEAVY_FILES; 154 for file in $HEAVY_FILES;
152 do 155 do
153 ls "$projectpath"/$file >/dev/null 2>&1 || { 156 ls "$projectpath"/$file >/dev/null 2>&1 || {
154 [ $NO_UPLOAD -eq 0 ] && printf "The online compiler did not return all the files or failed without notice, please try again and/or change HEAVY_FILES to be less strict.\n\n" ||\ 157 [ $NO_UPLOAD -eq 0 ] && printf "The online compiler did not return all the files or failed without notice, please try again and/or change HEAVY_FILES to be less strict.\n\n" ||\
155 printf "Folder $projectpath does not contain a valid Heavy project\n"; 158 printf "Folder $projectpath does not contain a valid Heavy project\n";