Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CoTA
cota-infra
Commits
83bb69c6
Commit
83bb69c6
authored
Aug 27, 2025
by
Abhishek
Browse files
wait added in script
parent
69714190
Changes
1
Hide whitespace changes
Inline
Side-by-side
test-moodle.sh
View file @
83bb69c6
...
...
@@ -33,6 +33,27 @@ DB_NAME="moodle"
# ==============================================================================
echo
"🚀 Starting Definitive Moodle Automation Script..."
echo
" -> Using Moodle URL:
$MOODLE_URL
"
echo
" -> Using Backend URL:
$BACKEND_URL
"
# --- THIS IS THE FIX ---
# Instead of proceeding immediately, we will loop until the Moodle installation
# (run by docker-entrypoint.sh) is complete. We know it's complete when the
# config.php file exists inside the container.
echo
" -> Waiting for Moodle first-time installation to complete..."
timeout
=
300
# 5 minute timeout
while
!
docker
exec
"
$MOODLE_CONTAINER
"
[
-f
"
$MOODLE_ROOT_IN_CONTAINER
/config.php"
]
;
do
timeout
=
$((
timeout
-
5
))
if
[
$timeout
-le
0
]
;
then
echo
"❌ ERROR: Moodle installation timed out after 5 minutes."
docker logs
"
$MOODLE_CONTAINER
"
exit
1
fi
echo
" -> Installation not yet complete, waiting 5 more seconds..."
sleep
5
done
echo
"✅ Moodle installation complete (config.php found)."
# --- Pre-flight Checks & Plugin Install (Step 1) ---
if
!
docker ps
--format
'{{.Names}}'
|
grep
-qw
"
$MOODLE_CONTAINER
"
;
then
echo
"❌ Moodle container not running."
&&
exit
1
;
fi
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment