Skip to content

Latest commit

 

History

History
88 lines (65 loc) · 4.27 KB

File metadata and controls

88 lines (65 loc) · 4.27 KB

Moodle dev env

Requirements

  • WSL2 with Distro Ubuntu 24.04 ⚠️ Other Distros likely will not work out of the box as of dependency issues.
  • Docker Desktop

Warnings / Hints

  • To resolve any issues with shell scripts (typically ^M errors), disable automatic line ending conversion in git by running: git config --global core.autocrlf input The repo has to be cloned again after this change.

Preparations

This section will describe how to set up and reset the development environment.

  1. Enter WSL. This guide will use shell commands and therefore does not work with the Windows console.
  2. Clone this repository to a place of your choice (eg /home/<wsl username>/AdlerDevelopmentEnvironment).
  3. continue with the following sections

Install Moodle

  1. Run the setup.sh script as non-root user.
  2. Plugins: Clone all plugins to their corresponding directory. See the Adler LMS -> plugins.json for a list of all plugins and Moodle documentation for the target directories to clone it to. Example command: git clone <git url> local/adler
    • Note for playbook_adler: playbooks are subplugins of local_declarativesetup. The plugin directory is local/declarativesetup/playbook
  3. Run adler playbook DECLARATIVE_SETUP_MANAGER_PASSWORD='Manager1234!1234' DECLARATIVE_SETUP_STUDENT_PASSWORD='Student1234!1234' php local/declarativesetup/cli/run_playbook.php -p=adler -r=test_users,moodle_dev_env

Start Development Server

Note

The PHP built-in server (php -S) is slower compared to a full web server. For better performance, consider using a full web server like Caddy or Apache. See Alternative Web Server Setup for detailed instructions. PHP built-in server was chosen because other servers are more complex to set up and potential require more system modifiacations.

After completing the installation above, start the development server:

cd ~/moodle/moodle && php -S localhost:5080

Press Ctrl+C to stop the server.

Access Moodle

Reset environment

To reset the environment and start fresh, manually delete the following:

  1. Create a backup using the provided backup script: backup_data.sh
  2. Database:
  3. If using docker (default): Stop and remove Docker containers and volumes: docker compose down -v
  4. If using another database server: Drop the Moodle database
  5. Moodle data directories: clear the Moodle data directories:
    • rm -rf ~/moodle/moodledata
    • rm -rf ~/moodle/moodledata_bht
    • rm -rf ~/moodle/moodledata_phpu
  6. Moodle config: delete the Moodle configuration file config.php

After this cleanup, you can run the setup script again.

backup and restore scripts

  • backup_data.sh: Creates a backup of Moodle data and database. Run using ./backup_data.sh.
  • restore_data.sh: Restores Moodle from a backup. Use it like ./restore_data.sh /path/to/backup.

Configure development and test tools

The previous steps did just set up the base moodle environment. The following guides will help configuring test and debug tools.

Debugging

Testing

Further manuals/instructions