From 99db197a3911910206e0aff359c565b0831071f8 Mon Sep 17 00:00:00 2001 From: John Guan Date: Wed, 1 Dec 2021 21:31:17 +0800 Subject: [PATCH] Update demo.yml --- .github/workflows/demo.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index 3196258..a496eff 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -48,14 +48,13 @@ jobs: - name: Wait for new instance running run: | TIMEOUT=$(($(date +%s)+600)) - while [ $(date +%s) -gt $TIMEOUT ] \ - do \ - NEW_INSTANCE_STATE=$(aws lightsail get-instance-state --instance-name ${{ env.OLD_INSTANCE_NAME }} | grep '"name":' | sed 's/ //g' | sed 's/"//g' | sed 's/name://g') \ - if [ $NEW_INSTANCE_STATE == running ] \ - then \ - echo "New instance is running now" \ - break \ - fi \ + while [ $TIMEOUT -gt $(date +%s) ] + do + NEW_INSTANCE_STATE=$(aws lightsail get-instance-state --instance-name ${{ env.OLD_INSTANCE_NAME }} | grep '"name":' | sed 's/ //g' | sed 's/"//g' | sed 's/name://g') + if [ $NEW_INSTANCE_STATE == running ] + echo "New instance is running now" + break + fi done - name: Put instance public ports