Skip to content

Commit ec18915

Browse files
author
Nicolas Huray
committed
Remove usage of a temp file for displaying deployment overview
1 parent 3be0f9a commit ec18915

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

run.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -340,16 +340,16 @@ if [ 'true' = "$DEPLOYMENT_OVERVIEW" ]; then
340340
while :
341341
do
342342
sleep 5
343-
DEPLOYMENT_GET_OUTPUT=$($DEPLOYMENT_GET 2>&1 > /tmp/$DEPLOYMENT_ID)
343+
DEPLOYMENT_GET_OUTPUT=$($DEPLOYMENT_GET 2>&1)
344344
if [ $? -ne 0 ]; then
345345
warn "$DEPLOYMENT_OUTPUT"
346346
error "Deployment of application '$APPLICATION_NAME' on deployment group '$DEPLOYMENT_GROUP' failed"
347347
exit 1
348348
fi
349349

350350
# Deployment Status
351-
STATUS=$(cat /tmp/$DEPLOYMENT_ID | jsonValue 'status' | tr -d '\r\n' | tr -d ' ')
352-
ERROR_MESSAGE=$(cat /tmp/$DEPLOYMENT_ID | jsonValue 'message')
351+
STATUS=$(echo $DEPLOYMENT_GET_OUTPUT | jsonValue 'status' | tr -d '\r\n' | tr -d ' ')
352+
ERROR_MESSAGE=$(echo $DEPLOYMENT_GET_OUTPUT | jsonValue 'message')
353353

354354
# Deployment failed
355355
if [ "$STATUS" = 'Failed' ]; then
@@ -358,11 +358,11 @@ if [ 'true' = "$DEPLOYMENT_OVERVIEW" ]; then
358358
fi
359359

360360
# Deployment Overview
361-
IN_PROGRESS=$(cat /tmp/$DEPLOYMENT_ID | jsonValue 'InProgress' | tr -d '\r\n' | tr -d ' ')
362-
PENDING=$(cat /tmp/$DEPLOYMENT_ID | jsonValue 'Pending' | tr -d '\r\n' | tr -d ' ')
363-
SKIPPED=$(cat /tmp/$DEPLOYMENT_ID | jsonValue 'Skipped' | tr -d '\r\n' | tr -d ' ')
364-
SUCCEEDED=$(cat /tmp/$DEPLOYMENT_ID | jsonValue 'Succeeded' | tr -d '\r\n' | tr -d ' ')
365-
FAILED=$(cat /tmp/$DEPLOYMENT_ID | jsonValue 'Failed' | tr -d '\r\n' | tr -d ' ')
361+
IN_PROGRESS=$(echo $DEPLOYMENT_GET_OUTPUT | jsonValue 'InProgress' | tr -d '\r\n' | tr -d ' ')
362+
PENDING=$(echo $DEPLOYMENT_GET_OUTPUT | jsonValue 'Pending' | tr -d '\r\n' | tr -d ' ')
363+
SKIPPED=$(echo $DEPLOYMENT_GET_OUTPUT | jsonValue 'Skipped' | tr -d '\r\n' | tr -d ' ')
364+
SUCCEEDED=$(echo $DEPLOYMENT_GET_OUTPUT | jsonValue 'Succeeded' | tr -d '\r\n' | tr -d ' ')
365+
FAILED=$(echo $DEPLOYMENT_GET_OUTPUT | jsonValue 'Failed' | tr -d '\r\n' | tr -d ' ')
366366
echo "| In Progress: $IN_PROGRESS | Pending: $PENDING | Skipped: $SKIPPED | Succeeded: $SUCCEEDED | Failed: $FAILED |"
367367

368368
# Deployment succeeded

0 commit comments

Comments
 (0)