From 6f39d3be8f07afb5d8d07d4754b771b5f6c45d5e Mon Sep 17 00:00:00 2001 From: Benjamin Toll Date: Tue, 25 Feb 2020 14:07:39 -0500 Subject: [PATCH] Improve some error checking and logging for build process --- scripts/release/common/setup.sh | 14 ++++++++++++-- scripts/release/util/smoke_test.sh | 2 +- scripts/release/util/test_package.sh | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/release/common/setup.sh b/scripts/release/common/setup.sh index 069258b279..d6d05689ce 100755 --- a/scripts/release/common/setup.sh +++ b/scripts/release/common/setup.sh @@ -29,7 +29,13 @@ export BRANCH # Check out mkdir -p "${HOME}/go/src/github.com/algorand" -cd "${HOME}/go/src/github.com/algorand" && git clone --single-branch --branch "${BRANCH}" https://github.com/algorand/go-algorand go-algorand +cd "${HOME}/go/src/github.com/algorand" +if ! git clone --single-branch --branch "${BRANCH}" https://github.com/algorand/go-algorand go-algorand +then + echo There has been a problem cloning the "$BRANCH" branch. + exit 1 +fi + # TODO: if we are checking out a release tag, `git tag --verify` it export DEBIAN_FRONTEND=noninteractive @@ -95,7 +101,11 @@ EOF # Install aptly for building debian repo mkdir -p "$GOPATH/src/github.com/aptly-dev" cd "$GOPATH/src/github.com/aptly-dev" -git clone https://github.com/aptly-dev/aptly +if ! git clone https://github.com/aptly-dev/aptly +then + echo There has been a problem cloning the aptly project. + exit 1 +fi cd aptly && git fetch # As of 2019-06-06 release tag v1.3.0 is 2018-May, GnuPG 2 support was added in October but they haven't tagged a new release yet. Hash below seems to work so far. diff --git a/scripts/release/util/smoke_test.sh b/scripts/release/util/smoke_test.sh index 5f9b595e88..e5908cce8d 100755 --- a/scripts/release/util/smoke_test.sh +++ b/scripts/release/util/smoke_test.sh @@ -64,7 +64,7 @@ SHORT_HASH=${HASH:0:8} # Use a regex over the multi-line string. if [[ "$STR" =~ .*"$RELEASE.$CHANNEL [$BRANCH] (commit #$SHORT_HASH)".* ]] then - echo "$GREEN_FG[$0]$END_FG_COLOR The result of \`algod -v\` is a correct match." + echo -e "$GREEN_FG[$0]$END_FG_COLOR The result of \`algod -v\` is a correct match.\n$STR" exit 0 fi diff --git a/scripts/release/util/test_package.sh b/scripts/release/util/test_package.sh index 2b6672d52d..2148fb6f2c 100755 --- a/scripts/release/util/test_package.sh +++ b/scripts/release/util/test_package.sh @@ -122,11 +122,11 @@ check_failures() { build_images check_failures built -echo "$GREEN_FG[$0]$END_FG_COLOR Builds completed with no failures." +echo "$GREEN_FG[$0]$END_FG_COLOR All builds completed with no failures." run_images check_failures verified -echo "$GREEN_FG[$0]$END_FG_COLOR Runs completed with no failures." +echo "$GREEN_FG[$0]$END_FG_COLOR All runs completed with no failures." cleanup