From cc5c09ac0c7f397dd5b26d6d0a5b90e24a2eda4b Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Fri, 15 Feb 2019 21:04:14 -0800 Subject: [PATCH] upload lib for wallet on mac/linux Signed-off-by: Leo Chen --- scripts/go_executable_build.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/scripts/go_executable_build.sh b/scripts/go_executable_build.sh index fe3ad8bd2..f3cee2833 100755 --- a/scripts/go_executable_build.sh +++ b/scripts/go_executable_build.sh @@ -23,14 +23,16 @@ esac . "${progdir}/setup_bls_build_flags.sh" declare -A LIB -LIB[libbls384.so]=${BLS_DIR}/lib/libbls384.so -LIB[libmcl.so]=${MCL_DIR}/lib/libmcl.so if [ "$(uname -s)" == "Darwin" ]; then MD5='md5 -r' GOOS=darwin + LIB[libbls384.dylib]=${BLS_DIR}/lib/libbls384.dylib + LIB[libmcl.dylib]=${MCL_DIR}/lib/libmcl.dylib else MD5=md5sum + LIB[libbls384.so]=${BLS_DIR}/lib/libbls384.so + LIB[libmcl.so]=${MCL_DIR}/lib/libmcl.so fi function usage @@ -134,9 +136,11 @@ function upload_wallet case "$OS" in "Linux") - DEST=wallet/wallet ;; + DEST=wallet/wallet + DESTDIR=wallet ;; "Darwin") - DEST=wallet.osx/wallet ;; + DEST=wallet.osx/wallet + DESTDIR=wallet.osx ;; *) echo "Unsupported OS: $OS" return ;; @@ -144,6 +148,16 @@ function upload_wallet $AWSCLI s3 cp $BINDIR/wallet s3://$PUBBUCKET/$DEST $AWSCLI s3api put-object-acl --bucket $PUBBUCKET --key $DEST --acl public-read + + for lib in "${!LIB[@]}"; do + if [ -e ${LIB[$lib]} ]; then + $AWSCLI s3 cp ${LIB[$lib]} s3://${PUBBUCKET}/$DESTDIR/$lib --acl public-read + else + echo "!! MISSING $lib !!" + fi + done + + } ################################ MAIN FUNCTION ##############################