Moodle Development Machine Speedy(ish) Setup Script

Note: In the time since this was originally published I have updated the script based on the feedback I received here and to set up the currently supported branches.

I recently had to set up the laptop I will be taking on the road with me. While traveling I will be continuing my work as a developer on the Moodle core development team. Click here if you’re wondering “what the hell is a Moodle?”

Facing the task of setting up a new development machine I realized something. Its REALLY time consuming. For my own development I need a full working copy of Moodle for all currently supported versions. That’s currently 1.9, 2.0, 2.1 and master. Master being the new, as yet, unreleased version. That’s 4 copies of Moodle. I need another copy of each of those to perform integration testing of code written by other people. Doing that in my development copies risks polluting my commit history with commits that ultimately get rolled back. That’s bad. So that means 8 copies of Moodle. Each of them has its own database and file storage area in addition to its own version of the code.

Setting that up is easily a few days work. And what’s worse, if I have my laptop stolen or it gets broken I’ll have to do it all over again. You know what I need? I need a script. One that does all of this auto-magically! And with that I got to work producing a shell script to automate as much of the setup as possible.

Its not a work of art. It contains some very obvious cutting and pasting of code that should really be put in a function. It does however work. Be warned that it may take several hours to finish running.

It can be found in my github account which is right here.

Note: In the time since this was originally published I have updated the script based on the feedback I received here and to set up the currently supported branches.

Leave a Reply