From 3f2871a4e58bc8f8c9036c8b2a8adff3e3b2dc14 Mon Sep 17 00:00:00 2001 From: gdm85 Date: Fri, 16 Jan 2015 11:04:04 +0100 Subject: [PATCH] Added workaround for bug @stedolan/jq/671 --- docker/scripts/bitcoin-gitian-build.sh | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/docker/scripts/bitcoin-gitian-build.sh b/docker/scripts/bitcoin-gitian-build.sh index bab90a6..c4f38d7 100755 --- a/docker/scripts/bitcoin-gitian-build.sh +++ b/docker/scripts/bitcoin-gitian-build.sh @@ -39,20 +39,13 @@ else fi fi -## change the assert directory as desired -if [ -z "$SIGNER" ]; then - SIGNER="$USER" -fi - -## customize output volumes -if [ -z "$OUTPUTDIR" ]; then - OUTPUTDIR="$SCRIPTS/output" -fi - function read_commit() { local SHA="$1" + local OUTPUT set -o pipefail && \ - curl -s https://api.github.com/repos/bitcoin/bitcoin/commits/${SHA} | jq -r '.[0].sha' + OUTPUT=$(curl -s https://api.github.com/repos/bitcoin/bitcoin/commits/${SHA} | jq -r '.sha') && \ + test ! -z "$OUTPUT" && \ + echo "$OUTPUT" } ## run all necessary containers, detached @@ -113,6 +106,16 @@ function build_all() { done | $PARALLEL } +## change the assert directory as desired +if [ -z "$SIGNER" ]; then + SIGNER="$USER" +fi + +## customize output volumes +if [ -z "$OUTPUTDIR" ]; then + OUTPUTDIR="$SCRIPTS/output" +fi + set -o pipefail || exit $? ## always get latest release/rc if no commit environment was specified