Commit 89de1b2d authored by Abhishek's avatar Abhishek
Browse files

Update .gitlab-ci.yml file

parent e44b5849
Pipeline #11820 passed with stage
in 17 seconds
# This GitLab CI/CD pipeline is designed to run the complete Moodle
# automation script in a single, manually triggered job.
image: docker:20.10.16 image: docker:20.10.16
stages: stages:
...@@ -19,16 +16,20 @@ variables: ...@@ -19,16 +16,20 @@ variables:
run_full_automation: run_full_automation:
stage: full_test stage: full_test
when: manual when: manual
before_script: before_script:
- apk add --no-cache curl docker-compose bash jq - apk add --no-cache curl docker-compose bash jq
- echo "Docker version:"
- docker --version
- echo "Docker Compose version:"
- docker-compose --version
- echo "Checking Docker socket..."
- ls -l /var/run/docker.sock || echo "Docker socket not found!"
- echo "Verifying Docker daemon..." - echo "Verifying Docker daemon..."
- docker info || { echo "Failed to connect to Docker daemon!"; exit 1; } - docker info || { echo "Failed to connect to Docker daemon!"; exit 1; }
- echo "Setting up named volume..." - echo "Setting up named volume..."
- docker volume create cota-infra_dta_tests_data - docker volume create cota-infra_dta_tests_data
- 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..." - echo "Creating .env file for Docker Compose..."
- echo "MOODLE_WWWROOT=${MOODLE_WWWROOT}" > .env - echo "MOODLE_WWWROOT=${MOODLE_WWWROOT}" > .env
...@@ -38,6 +39,8 @@ run_full_automation: ...@@ -38,6 +39,8 @@ run_full_automation:
- echo "EGID=${EGID}" >> .env - echo "EGID=${EGID}" >> .env
- echo "Starting Docker environment..." - echo "Starting Docker environment..."
- docker-compose up -d - docker-compose up -d
- echo "Docker Compose services:"
- docker-compose ps
- echo "Waiting for Moodle first-time installation to complete..." - echo "Waiting for Moodle first-time installation to complete..."
- | - |
timeout=300 timeout=300
...@@ -55,7 +58,6 @@ run_full_automation: ...@@ -55,7 +58,6 @@ run_full_automation:
- chmod +x test-moodle.sh - chmod +x test-moodle.sh
- echo "Executing the main automation script..." - echo "Executing the main automation script..."
- ./test-moodle.sh - ./test-moodle.sh
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