Commit 9716ed68 authored by Abhishek's avatar Abhishek
Browse files

Update .gitlab-ci.yml file

parent 79a7359e
Pipeline #11799 passed with stage
in 9 minutes and 12 seconds
......@@ -5,21 +5,22 @@ image: docker:20.10.16
services:
- name: docker:20.10.16-dind
alias: docker # This alias is important for the runner to find the Docker daemon.
alias: docker
stages:
- full_test # A single stage for our end-to-end test.
- full_test
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
EUSER: "1000"
EGID: "1000"
MOODLE_URL: "http://docker:8080"
BACKEND_URL: "http://docker:8081"
MOODLE_WWWROOT: "http://docker:8080" # For the entrypoint installation
MOODLE_URL: "http://docker:8080" # For the test script's curl commands
# Add the admin credentials here so they are also written to the .env file
MOODLE_ADMIN_USER: "user"
MOODLE_ADMIN_PASS: "QAYwsx@12345"
# This is the URL Moodle's entrypoint script will use for its wwwroot.
MOODLE_WWWROOT: "http://docker:8080"
run_full_automation:
stage: full_test
when: manual
......@@ -29,12 +30,20 @@ run_full_automation:
- until docker info > /dev/null 2>&1; do echo "Waiting for Docker daemon..."; sleep 3; done
script:
# --- THIS IS THE FIX ---
# Create a .env file on the fly. Docker Compose will automatically read this
# file and pass the variables to the containers.
- echo "Creating .env file for Docker Compose..."
- echo "MOODLE_WWWROOT=${MOODLE_WWWROOT}" > .env
- echo "MOODLE_ADMIN_USER=${MOODLE_ADMIN_USER}" >> .env
- echo "MOODLE_ADMIN_PASS=${MOODLE_ADMIN_PASS}" >> .env
- echo "EUSER=${EUSER}" >> .env
- echo "EGID=${EGID}" >> .env
- echo "Starting Docker environment..."
- docker-compose up -d
# --- THIS IS THE FIX ---
# Instead of a fixed sleep, we will loop until the Moodle installation is complete.
# We know it's complete when the config.php file exists.
# Loop until the Moodle installation is complete.
- echo "Waiting for Moodle first-time installation to complete..."
- |
timeout=300
......@@ -57,4 +66,4 @@ run_full_automation:
after_script:
- echo "Tearing down Docker environment..."
- docker-compose down -v
\ No newline at end of file
- docker-compose down -v
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment