-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gitpod is a free, cloud-based, development environment providing a suitable development environment right in your browser. The Moodle Gitpod template supports the following environment variables: * `MOODLE_REPOSITORY`. The Moodle repository to be cloned. The value should be URL encoded. If left undefined, the default repository `https://github.com/moodle/moodle.git` is used. * `MOODLE_BRANCH`. The Moodle branch to be cloned. If left undefined, the default branch `main` is employed.
- Loading branch information
Showing
5 changed files
with
119 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
local.yml | ||
/moodle/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
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="[email protected]" | ||
# 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) | ||
command: | | ||
# Update the patch to the latest version. | ||
cd moodle | ||
git fetch | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Initialize variables to get Moodle code. | ||
if [ -z "$MOODLE_REPOSITORY" ]; | ||
then | ||
export MOODLE_REPOSITORY=https://github.com/moodle/moodle.git | ||
fi | ||
if [ -z "$MOODLE_BRANCH" ]; | ||
then | ||
export MOODLE_BRANCH=main | ||
fi | ||
|
||
# Clone Moodle repository. | ||
cd "${GITPOD_REPO_ROOT}" && git clone --branch "${MOODLE_BRANCH}" --single-branch "${MOODLE_REPOSITORY}" moodle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters