Skip to content

Commit

Permalink
ci: refactor sitespeed login retry (#5347)
Browse files Browse the repository at this point in the history
  • Loading branch information
petermakowski authored Mar 14, 2024
1 parent d59ceb9 commit 96daa3c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/sitespeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,16 @@ jobs:
interval: 500
- name: Login MAAS admin
run: |
for i in {1..5}; do
export API_KEY=`sudo maas apikey --username=admin`
maas login admin http://localhost:5240/MAAS $API_KEY && break || sleep 10
# Retry admin login up to 5 times with 10s intervals to account for delays in MAAS becoming fully operational
for attempt in {1..5}; do
export API_KEY=$(sudo maas apikey --username=admin)
if maas login admin http://localhost:5240/MAAS $API_KEY; then
echo "Login successful."
break
else
echo "Login attempt $attempt failed. Retrying in 10 seconds..."
sleep 10
fi
done
- name: Wait for MAAS boot resources
shell: bash
Expand Down

0 comments on commit 96daa3c

Please sign in to comment.