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
3358edf7
Commit
3358edf7
authored
Oct 09, 2025
by
Abhishek
Browse files
Update .gitlab-ci.yml file
parent
04903631
Pipeline
#11981
skipped with stage
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
3358edf7
...
@@ -4,10 +4,7 @@ services:
...
@@ -4,10 +4,7 @@ services:
-
name
:
docker:20.10.16-dind
-
name
:
docker:20.10.16-dind
stages
:
stages
:
-
setup
-
full_test
-
install_plugin
-
teacher_workflow
-
student_workflow
variables
:
variables
:
DOCKER_HOST
:
tcp://docker:2375
DOCKER_HOST
:
tcp://docker:2375
...
@@ -24,8 +21,8 @@ variables:
...
@@ -24,8 +21,8 @@ variables:
DTA_CONFIG_FILE
:
"
teacher-dta-dir-test-runner-jdk21.txt"
DTA_CONFIG_FILE
:
"
teacher-dta-dir-test-runner-jdk21.txt"
DTA_STUDENT_SUBMISSION_FILE
:
"
student-dir.txt"
DTA_STUDENT_SUBMISSION_FILE
:
"
student-dir.txt"
setup_environment
:
run_full_automation
:
stage
:
setup
stage
:
full_test
when
:
manual
when
:
manual
before_script
:
before_script
:
-
apk add --no-cache curl bash jq bind-tools
-
apk add --no-cache curl bash jq bind-tools
...
@@ -38,70 +35,33 @@ setup_environment:
...
@@ -38,70 +35,33 @@ setup_environment:
-
echo "Setting permissions on dta_tests_data volume..."
-
echo "Setting permissions on dta_tests_data volume..."
-
docker run --rm -v cota-infra_dta_tests_data:/data alpine chown 137:137 /data
-
docker run --rm -v cota-infra_dta_tests_data:/data alpine chown 137:137 /data
script
:
script
:
-
echo "Creating .env file for Docker Compose..."
-
apk add --no-cache curl bash jq git bind-tools
-
echo "MOODLE_WWWROOT=${MOODLE_WWWROOT}" > .env
-
docker volume create cota-infra_dta_tests_data
-
echo "MOODLE_ADMIN_USER=${MOODLE_ADMIN_USER}" >> .env
-
docker run --rm -v cota-infra_dta_tests_data:/data alpine chown 137:137 /data
-
echo "MOODLE_ADMIN_PASS=${MOODLE_ADMIN_PASS}" >> .env
-
echo "EUSER=${EUSER}" >> .env
-
echo "Creating .env..."
-
echo "EGID=${EGID}" >> .env
-
echo "MOODLE_WWWROOT=http://docker:8080" > .env
-
echo "MOODLE_ADMIN_USER=user" >> .env
-
echo "MOODLE_ADMIN_PASS=QAYwsx@12345" >> .env
-
echo "EUSER=appuser" >> .env
-
echo "EGID=137" >> .env
-
echo "Starting Docker environment..."
-
docker compose up -d
-
docker compose up -d
-
echo "Waiting for Moodle
first-time
installation
to complete
..."
-
echo "Waiting for Moodle installation..."
-
|
-
|
timeout=300
timeout=300
while ! docker exec moodle-web-official [ -f /var/www/html/config.php ]; do
while ! docker exec moodle-web-official [ -f /var/www/html/config.php ]; do
timeout=$((timeout - 5))
timeout=$((timeout - 5))
if [ $timeout -le 0 ]; then
if [ $timeout -le 0 ]; then
echo "❌
ERROR:
Moodle installation timed out
after 5 minutes.
"
echo "❌ Moodle installation timed out"
docker
logs moodle-web-official
docker
ps -a
exit 1
exit 1
fi
fi
echo " ->
Installation not yet complete, waiting 5 more seconds
..."
echo " ->
Not ready, waiting
..."
sleep 5
sleep 5
done
done
-
echo "✅ Moodle installation complete (config.php found)."
artifacts
:
paths
:
-
.env
expire_in
:
1 hour
# 🧩 Stage 1: Install and activate plugin inside Moodle container
-
echo "✅ Moodle ready!"
install_plugin
:
stage
:
install_plugin
needs
:
[
setup_environment
]
script
:
-
source .env
-
apk add --no-cache bash curl jq git
-
bash ./script_step1.sh
-
bash ./script_step1.sh
artifacts
:
paths
:
-
.env
expire_in
:
1 hour
# 🧩 Stage 2: Teacher workflow — creates course, assignment, and saves outputs
teacher_workflow
:
stage
:
teacher_workflow
script
:
-
apk add --no-cache bash curl jq git
-
echo "Running teacher workflow..."
-
bash ./script_step2.sh
-
bash ./script_step2.sh
artifacts
:
-
bash ./script_step3.sh
paths
:
\ No newline at end of file
-
.env
# Contains course_id, assignment_id, etc.
expire_in
:
1 day
needs
:
-
job
:
install_plugin
artifacts
:
true
# 🧩 Stage 3: Student workflow — uses env values from Stage 2
student_workflow
:
stage
:
student_workflow
script
:
-
apk add --no-cache bash curl jq git
-
echo "Running student submission workflow..."
-
bash ./script_step3.sh
needs
:
-
job
:
teacher_workflow
artifacts
:
true
when
:
manual
# You can run it manually if needed
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