mirror of
https://gitlab.opencode.de/bmi/opendesk/deployment/opendesk.git
synced 2025-12-05 23:11:40 +01:00
ci(import-default-accounts): Up to 5 retries with pause on failing account import
This commit is contained in:
@@ -767,6 +767,10 @@ import-default-accounts:
|
||||
- "echo \"Starting default account import for ${DOMAIN}\""
|
||||
- "cd /app"
|
||||
- |
|
||||
set +e
|
||||
success=0
|
||||
for i in {1..5}; do
|
||||
echo "Attempt $i/5..."
|
||||
./user_import_udm_rest_api.py \
|
||||
--import_domain ${DOMAIN} \
|
||||
--udm_api_password ${DEFAULT_ADMINISTRATOR_PASSWORD} \
|
||||
@@ -778,6 +782,18 @@ import-default-accounts:
|
||||
--create_admin_accounts True \
|
||||
--create_maildomains True \
|
||||
--verify_certificate False
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Script succeeded on attempt $i."
|
||||
success=1
|
||||
break
|
||||
fi
|
||||
echo "Script failed. Waiting 60 seconds before retry..."
|
||||
sleep 60
|
||||
done
|
||||
if [ "$success" -ne 1 ]; then
|
||||
echo "Script failed after 5 attempts."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run-tests:
|
||||
stage: "post-execute"
|
||||
|
||||
Reference in New Issue
Block a user