forked from lthn/blockchain
build: macOS build script updated
This commit is contained in:
parent
f8d953afe2
commit
57cf32b6be
2 changed files with 58 additions and 4 deletions
|
|
@ -148,13 +148,17 @@ echo "Build success"
|
||||||
|
|
||||||
echo "############### Uploading... ################"
|
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
|
if [ $? -ne 0 ]; then
|
||||||
echo "Failed to upload to remote server"
|
echo "Failed to upload to remote server"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
popd
|
||||||
|
|
||||||
|
|
||||||
read checksum <<< $( shasum -a 256 $package_filepath | awk '/^/ { print $1 }' )
|
read checksum <<< $( shasum -a 256 $package_filepath | awk '/^/ { print $1 }' )
|
||||||
|
|
@ -165,8 +169,7 @@ sha256: $checksum"
|
||||||
|
|
||||||
echo "$mail_msg"
|
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
|
# notarization
|
||||||
|
|
|
||||||
51
utils/macosx_build_uploader.sh
Normal file
51
utils/macosx_build_uploader.sh
Normal file
|
|
@ -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=$(<DONE)
|
||||||
|
|
||||||
|
if [ "$rc" -eq 0 ]
|
||||||
|
then
|
||||||
|
echo "Upload successful."
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Upload unsuccessfull, exit code = $rc."
|
||||||
|
return $rc
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue