From b814fa056bc51d8992e8227acfe8acd7973f4bd8 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Tue, 19 Mar 2019 07:06:15 +0000 Subject: [PATCH] [build] add -v option in build script -v will output a lot of build process Signed-off-by: Leo Chen --- scripts/go_executable_build.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/go_executable_build.sh b/scripts/go_executable_build.sh index e2fb4fba4..ff4a72e13 100755 --- a/scripts/go_executable_build.sh +++ b/scripts/go_executable_build.sh @@ -13,6 +13,7 @@ GOOS=linux GOARCH=amd64 FOLDER=/${WHOAMI:-$USER} RACE= +VERBOSE= unset -v progdir case "${0}" in @@ -50,6 +51,7 @@ OPTIONS: -b bucket set the upload bucket name (default: $BUCKET) -f folder set the upload folder name in the bucket (default: $FOLDER) -r enable -race build option (default: $RACE) + -v verbose build process (default: $VERBOSE) ACTION: build build binaries only (default action) @@ -87,7 +89,7 @@ function build_only if [[ -z "$build" || "$bin" == "$build" ]]; then rm -f $BINDIR/$bin echo "building ${SRC[$bin]}" - env GOOS=$GOOS GOARCH=$GOARCH go build -v -x -ldflags="-X main.version=v${VERSION} -X main.commit=${COMMIT} -X main.builtAt=${BUILTAT} -X main.builtBy=${BUILTBY}" -o $BINDIR/$bin $RACE ${SRC[$bin]} + env GOOS=$GOOS GOARCH=$GOARCH go build $VERBOSE -ldflags="-X main.version=v${VERSION} -X main.commit=${COMMIT} -X main.builtAt=${BUILTAT} -X main.builtBy=${BUILTBY}" -o $BINDIR/$bin $RACE ${SRC[$bin]} if [ "$(uname -s)" == "Linux" ]; then $BINDIR/$bin -version fi @@ -116,7 +118,7 @@ function upload if [ -e ${LIB[$lib]} ]; then $AWSCLI s3 cp ${LIB[$lib]} s3://${BUCKET}$FOLDER/$lib --acl public-read else - echo "!! MISSING $lib !!" + echo "!! MISSING ${LIB[$lib]} !!" fi done @@ -153,7 +155,7 @@ function upload_wallet if [ -e ${LIB[$lib]} ]; then $AWSCLI s3 cp ${LIB[$lib]} s3://${PUBBUCKET}/$DESTDIR/$lib --acl public-read else - echo "!! MISSING $lib !!" + echo "!! MISSING ${LIB[$lib]} !!" fi done @@ -161,7 +163,7 @@ function upload_wallet } ################################ MAIN FUNCTION ############################## -while getopts "hp:a:o:b:f:r" option; do +while getopts "hp:a:o:b:f:rv" option; do case $option in h) usage ;; p) PROFILE=$OPTARG ;; @@ -170,6 +172,7 @@ while getopts "hp:a:o:b:f:r" option; do b) BUCKET=$OPTARG/ ;; f) FOLDER=$OPTARG ;; r) RACE=-race ;; + v) VERBOSE='-v -x' ;; esac done