Back to catalogue
Project
Moodle Installer
Modular deployment tooling for repeatable Moodle installation and upgrades, with automated checks.
How it’s builtHow it’s built
Moodle Installer · Cross-platform Bash installer and CI/CD generator for Moodle 4.1 to 5.1
MoodleDeploy is a Bash tool that installs or upgrades Moodle 4.1 to 5.1 on Linux and Windows (Git Bash, MSYS2 or WSL). It covers four cases: a fresh server, an existing server, cPanel hosting, and generating a GitHub Actions pipeline. I wrote all 4,171 lines of shell across 14 scripts, with per-version PHP and database requirement checks and an upgrade manager. 156 Bats test cases cover it.
- install scenarios
- 4
- supported Moodle versions
- 6
- Bats test cases
- 156
- lines of Bash
- 4,171
- commits, all mine
- 20
Technology and what it does here
- Bash 4+
- Installer core, platform abstraction, checks and upgrade manager
- Apache2, PHP 8.3, MariaDB/MySQL
- Stack installed in the fresh-server case
- Redis
- Installed with php-redis for Moodle caching
- OPcache
- Enabled and tuned in php.ini by case_a_fresh.sh
- Chocolatey
- Package manager for the Windows platform layer
- GitHub Actions
- Cicd_setup.sh generates a test, build, deploy workflow and server deploy script
- Bats
- Regression and preservation tests, including MySQL version compatibility
Implementation details
- A platform abstraction layer routes package installs to apt or Chocolatey so the same scenarios run on Linux and Windows.
- Per-version PHP and database minimums are checked before install, for example MySQL 8.0.30+ for 4.4 to 5.1.
- The CI/CD generator warns against root SSH and writes a GitHub Actions workflow plus deploy script.
Technologies
- Bash
- Moodle
- Deployment
