"Source/git@transfer.hft-stuttgart.de:knight/ASYST.git" did not exist on "b0ea3986d1a7418fa9732989ea6fa6f08853c59f"
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 ...@@ -5,21 +5,22 @@ image: docker:20.10.16
services: services:
- name: docker:20.10.16-dind - name: docker:20.10.16-dind
alias: docker # This alias is important for the runner to find the Docker daemon. alias: docker
stages: stages:
- full_test # A single stage for our end-to-end test. - full_test
variables: variables:
DOCKER_HOST: tcp://docker:2375 DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: "" DOCKER_TLS_CERTDIR: ""
EUSER: "1000" EUSER: "1000"
EGID: "1000" EGID: "1000"
MOODLE_URL: "http://docker:8080" MOODLE_WWWROOT: "http://docker:8080" # For the entrypoint installation
BACKEND_URL: "http://docker:8081" 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: run_full_automation:
stage: full_test stage: full_test
when: manual when: manual
...@@ -29,12 +30,20 @@ run_full_automation: ...@@ -29,12 +30,20 @@ run_full_automation:
- until docker info > /dev/null 2>&1; do echo "Waiting for Docker daemon..."; sleep 3; done - until docker info > /dev/null 2>&1; do echo "Waiting for Docker daemon..."; sleep 3; done
script: 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..." - echo "Starting Docker environment..."
- docker-compose up -d - docker-compose up -d
# --- THIS IS THE FIX --- # Loop until the Moodle installation is complete.
# 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.
- echo "Waiting for Moodle first-time installation to complete..." - echo "Waiting for Moodle first-time installation to complete..."
- | - |
timeout=300 timeout=300
...@@ -57,4 +66,4 @@ run_full_automation: ...@@ -57,4 +66,4 @@ run_full_automation:
after_script: after_script:
- echo "Tearing down Docker environment..." - echo "Tearing down Docker environment..."
- docker-compose down -v - docker-compose down -v
\ No newline at end of file
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