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
71c56e9b
Commit
71c56e9b
authored
Sep 07, 2025
by
Abhishek
Browse files
Update .gitlab-ci.yml file
parent
f185eb0e
Pipeline
#11829
failed with stage
in 1 minute and 50 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
71c56e9b
...
...
@@ -28,54 +28,51 @@ variables:
run_full_automation
:
stage
:
full_test
script
:
# 1. Install curl + netcat-openbsd
-
apt-get update && apt-get install -y curl netcat-openbsd
# 2. Start Apache in background
-
echo "🚀 Starting Apache..."
-
apache2ctl -D FOREGROUND &
-
sleep
10
# 3. Wait for MariaDB
-
echo "⏳ Waiting for MariaDB..."
-
timeout=180
-
until mysqladmin ping -h"db" --silent; do
timeout=$((timeout - 5));
-
|
until mysqladmin ping -h"db" --silent; do
timeout=$((timeout - 5))
if [ $timeout -le 0 ]; then
echo "❌ MariaDB did not start after 3 minutes."
;
exit 1
;
fi
;
echo " -> DB not ready, retrying in 5s"
;
sleep 5
;
echo "❌ MariaDB did not start after 3 minutes."
exit 1
fi
echo " -> DB not ready, retrying in 5s"
sleep 5
done
-
echo "✅ MariaDB is ready."
# 4. Wait for backend TCP port
-
echo "⏳ Waiting for backend:8080..."
-
timeout=180
-
until nc -z backend 8080; do
timeout=$((timeout - 5));
-
|
until nc -z backend 8080; do
timeout=$((timeout - 5))
if [ $timeout -le 0 ]; then
echo "❌ Backend port 8080 not reachable after 3 minutes."
;
exit 1
;
fi
;
echo " -> Backend not ready, retrying in 5s"
;
sleep 5
;
echo "❌ Backend port 8080 not reachable after 3 minutes."
exit 1
fi
echo " -> Backend not ready, retrying in 5s"
sleep 5
done
-
echo "✅ Backend port is open."
# 5. Try /actuator/health if available (non-blocking)
-
echo "⏳ Checking backend health endpoint..."
-
if curl -s -f $BACKEND_URL/actuator/health > /dev/null; then
echo "✅ Backend health endpoint OK";
-
|
if curl -s -f $BACKEND_URL/actuator/health >/dev/null; then
echo "✅ Backend health endpoint OK"
else
echo "⚠️ Backend health endpoint not available, continuing anyway"
;
echo "⚠️ Backend health endpoint not available, continuing anyway"
fi
# Wait for Moodle to become live
-
echo "⏳ Waiting for Moodle to be ready..."
-
timeout=300
-
until curl -s -f http://localhost >/dev/null; do
-
echo "⏳ Waiting for Moodle web server to be ready..."
-
|
until curl -s -f http://localhost >/dev/null; do
timeout=$((timeout - 5))
if [ $timeout -le 0 ]; then
echo "❌ Moodle did not become ready in 5 minutes"
...
...
@@ -86,6 +83,6 @@ run_full_automation:
done
-
echo "✅ Moodle is live"
# Now run th
e automation
-
echo "▶️ Running Moodl
e automation
..."
-
chmod +x test-moodle.sh
-
./test-moodle.sh
\ No newline at end of file
-
./test-moodle.sh
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