Skip to content

Commit 4824361

Browse files
committed
APM-3869 Try not using tee
1 parent 85a0bee commit 4824361

1 file changed

Lines changed: 26 additions & 7 deletions

File tree

azure/components/cleanup-ecs-pr-proxies-job.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,11 @@ steps:
1111
- bash: |
1212
make remove-stale-locks
1313
export retain_hours=72
14-
ANSIBLE_FORCE_COLOR=yes make -C ansible remove-old-ecs-pr-deploys | tee /tmp/output.txt
14+
ANSIBLE_FORCE_COLOR=yes make -C ansible remove-old-ecs-pr-deploys
1515
ERROR_CODE=$?
1616
echo ERROR_CODE - $ERROR_CODE
17-
ROLE_TIMEOUT_MSG="The AWS assume role session token is due to expire"
18-
if grep -q "$ROLE_TIMEOUT_MSG" /tmp/output.txt ; then
19-
echo "stderr for ansible has the error \"$ROLE_TIMEOUT_MSG\""
20-
echo "Re-assuming role and re-running step"
21-
echo "##vso[task.setvariable variable=should_retry;]true"
2217
23-
elif [ $ERROR_CODE -ne 0 ] ; then
18+
if [ $ERROR_CODE -ne 0 ] ; then
2419
echo "\n\nansible has unhandled error, re-raising"
2520
echo "##vso[task.setvariable variable=should_retry;]true"
2621
@@ -31,3 +26,27 @@ steps:
3126
3227
displayName: "cleanup older pr deploys"
3328
condition: or(eq( ${{ parameters.retry }}, '0'), eq(variables['should_retry'], 'true'))
29+
30+
# - bash: |
31+
# make remove-stale-locks
32+
# export retain_hours=72
33+
# ANSIBLE_FORCE_COLOR=yes make -C ansible remove-old-ecs-pr-deploys | tee /tmp/output.txt
34+
# ERROR_CODE=$?
35+
# echo ERROR_CODE - $ERROR_CODE
36+
# ROLE_TIMEOUT_MSG="The AWS assume role session token is due to expire"
37+
# if grep -q "$ROLE_TIMEOUT_MSG" /tmp/output.txt ; then
38+
# echo "stderr for ansible has the error \"$ROLE_TIMEOUT_MSG\""
39+
# echo "Re-assuming role and re-running step"
40+
# echo "##vso[task.setvariable variable=should_retry;]true"
41+
42+
# elif [ $ERROR_CODE -ne 0 ] ; then
43+
# echo "\n\nansible has unhandled error, re-raising"
44+
# echo "##vso[task.setvariable variable=should_retry;]true"
45+
46+
# exit -1
47+
# else
48+
# echo "##vso[task.setvariable variable=should_retry;]false"
49+
# fi
50+
51+
# displayName: "cleanup older pr deploys"
52+
# condition: or(eq( ${{ parameters.retry }}, '0'), eq(variables['should_retry'], 'true'))

0 commit comments

Comments
 (0)