Update demo.yml

This commit is contained in:
John Guan 2021-12-01 21:31:17 +08:00 committed by GitHub
parent 7e2a5d553c
commit 99db197a39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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