-
Notifications
You must be signed in to change notification settings - Fork 254
/
.gitpod.yml
59 lines (45 loc) · 2.04 KB
/
.gitpod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
tasks:
- name: Moodle Docker
before: |
# Set up Moodle docker environment vars.
export COMPOSE_PROJECT_NAME=moodle-gitpod
export MOODLE_DOCKER_WWWROOT="$GITPOD_REPO_ROOT"/moodle
export MOODLE_DOCKER_DB=pgsql
init: |
# Set up Moodle repository.
.gitpod/setup-env.sh
# Ensure customized config.php for the Docker containers is in place
cp config.docker-template.php $MOODLE_DOCKER_WWWROOT/config.php
# Start up containers.
bin/moodle-docker-compose up -d
# Wait for DB to come up.
bin/moodle-docker-wait-for-db
# Initialize Moodle database for manual testing.
bin/moodle-docker-compose exec webserver php admin/cli/install_database.php --agree-license --fullname="Docker moodle" --shortname="docker_moodle" --summary="Docker moodle site" --adminpass="test" --adminemail="admin@example.com"
# Hack to avoid when the workspace is restarted.
# It can be removed when https://github.com/gitpod-io/gitpod/issues/17551 is fixed.
bin/moodle-docker-compose exec webserver bash -c 'rm -rf /var/log/apache2/*'
# Open Moodle site in browser.
gp ports await 8000 && gp preview $(gp url 8000)
# Change permissions to allow installation of plugins.
bin/moodle-docker-compose exec webserver bash -c 'chmod -R 777 .'
# Add some data if the file exists.
if [ -r "moodle/admin/tool/generator/tests/fixtures/gitpod-basic-scenario.feature" ];
then
bin/moodle-docker-compose exec webserver php admin/tool/generator/cli/runtestscenario.php --feature=./../tests/fixtures/gitpod-basic-scenario.feature
fi
command: |
# Update the patch to the latest version.
cd moodle
git fetch $(git rev-parse --symbolic-full-name --abbrev-ref @{upstream} | sed 's!/! !')
git reset --hard
cd ..
# Start up containers.
bin/moodle-docker-compose up -d
# Wait for DB to come up.
bin/moodle-docker-wait-for-db
ports:
- port: 8000
name: Moodle server
visibility: public
onOpen: ignore