diff --git a/utils/build_script_mac_osx.sh b/utils/build_script_mac_osx.sh index 7216d9d4..6f842883 100755 --- a/utils/build_script_mac_osx.sh +++ b/utils/build_script_mac_osx.sh @@ -148,13 +148,17 @@ echo "Build success" echo "############### Uploading... ################" -package_filepath=$package_filename +package_filepath="$(pwd)/$package_filename" -scp $package_filepath zano_build_server:/var/www/html/builds/ +#scp $package_filepath zano_build_server:/var/www/html/builds/ +source ../../../macosx_build_uploader.sh +pushd . +upload_build $package_filepath if [ $? -ne 0 ]; then echo "Failed to upload to remote server" exit 1 fi +popd read checksum <<< $( shasum -a 256 $package_filepath | awk '/^/ { print $1 }' ) @@ -165,8 +169,7 @@ sha256: $checksum" echo "$mail_msg" -python3 ../../../utils/build_mail.py "Zano linux-x64 ${build_prefix_label}${testnet_label}build $version_str" "${emails}" "$mail_msg" - +python3 ../../../utils/build_mail.py "Zano macOS-x64 ${build_prefix_label}${testnet_label}build $version_str" "${emails}" "$mail_msg" ###################### # notarization diff --git a/utils/macosx_build_uploader.sh b/utils/macosx_build_uploader.sh new file mode 100644 index 00000000..acd23652 --- /dev/null +++ b/utils/macosx_build_uploader.sh @@ -0,0 +1,51 @@ +set +e +curr_path=${BASH_SOURCE%/*} + +function upload_build() # $1 - path to the file to be uploaded +{ + if [ -z "$1" ] + then + echo "ERROR: upload_build is called with no or invalid parameters" + return 1 + fi + + # check if the directory contains files + #if [ -n "$(ls -A "$ZANO_BLD_UPL_DIR" 2>/dev/null)" ] + #then + # echo "ERROR: uploading folder contains files" + # return 1 + #fi + + cd "$ZANO_BLD_UPL_DIR" || return 2 + rm -rf ./* || return 3 + #popd || return 4 + + touch WAIT || return 5 + cp $1 . || return 6 + rm WAIT || return 7 + + counter=0 + while [ ! -f DONE ] + do + if [ "$counter" -ge 150 ] + then + echo "ERROR: uploading is taking longer than expected" + touch STOP + return 8 + fi + sleep 2 + echo "waiting..." + counter=$((counter + 1)) + done + + rc=$(