The MoodleBuild toolchain patches and packages a Moodle source code directory into a Windows Azure Package using the Azure SDK directly, instead of relying on third-party tools. This allows an easier way to update and customize Moodle, components and the Windows Azure SDK without the hassle of using outdated and incompatible versions.
The core of this toolchain is a batch file named build.cmd. This script patches and packages Moodle using the tools and components included on the package available to download.

How to pack Moodle using the toolchain

  1. Download a Moodle release tarball from and extract it to the moodle/ directory or do a git clone on the moodle/ directory.
  2. Apply any patches or changes you want to this directory.
  3. Open build.cmd with your favorite text editor and check if the Azure SDK path is correct (AZURESDKPATH). MOODLEVERSION should be 2.1 for releases since 22 Jul 2011, even if you are using version 2.0.
  4. Open a command prompt window and navigate to the directory where build.cmd is located.
  5. Run build.cmd -k. It will run all steps necessary to pack Moodle into a deployable Azure package.

build.cmd options

  • -d: Copies config_check.php to the package, allowing anyone to open and see if Moodle is loading the correct settings from your ServiceConfiguration.cscfg file. This is a security hole and will dump your passwords and keys to anyone accessing the page. This option is intended for debugging purposes only.
  • -p: Copies and patches Moodle from moodle/ to the build directory.
  • -c: Copies PHP and dependencies to the build directory. If the -p step hasn't been run yet, it runs it.
  • -k: Packages Moodle using cspack.exe from the SDK. If the previous steps haven't been run yet, it runs them.

Last edited Aug 17, 2011 at 6:25 AM by rescbr, version 1


cody_huang Sep 28, 2011 at 10:55 AM 
very good thank u !