Skip to content

Commit a315026

Browse files
author
Matthew Fisher
committed
fix(builder): suppress stderr
We don't need to know that parsing the object failed, as we're going to print the controller response shortly after. These errors do not provide anything useful. It's the controller response that we're interested in.
1 parent eb27432 commit a315026

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

builder/templates/builder

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,12 @@ RESPONSE=$(curl -s -XPOST \
9494
$URL)
9595

9696
# massage response for the environment variables in form HELLO=world
97-
CONFIG=$(echo $RESPONSE | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["values"]' | jq -c -M "to_entries|map(\"\(.key)=\(.value|tostring)\")|.[]" || echo $RESPONSE)
97+
CONFIG=$(echo $RESPONSE | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["values"]' | jq -c -M "to_entries|map(\"\(.key)=\(.value|tostring)\")|.[]" 2> /dev/null || echo $RESPONSE)
9898

9999
if [ "$CONFIG" == "$RESPONSE" ];
100100
then
101-
echo $RESPONSE
101+
puts-warn "failed retrieving config from controller"
102+
puts-warn $RESPONSE
102103
exit 1
103104
fi
104105

@@ -171,11 +172,13 @@ RESPONSE=$(curl -s -XPOST \
171172
--data "$DATA" \
172173
$URL)
173174

174-
RELEASE=$(echo $RESPONSE | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["release"]["version"]' || echo $RESPONSE)
175+
RELEASE=$(echo $RESPONSE | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["release"]["version"]' 2> /dev/null || echo $RESPONSE)
175176

176177
if [ "$RELEASE" == "$RESPONSE" ];
177178
then
178-
echo $RESPONSE
179+
# we're printing inline with "Launching..."
180+
echo "failed"
181+
puts-warn $RESPONSE
179182
exit 1
180183
fi
181184

0 commit comments

Comments
 (0)