Versão em Português: MoodleBuild Toolchain (pt-br)

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 Feb 15, 2012 at 6:12 AM by rescbr, version 7


demenskan May 26, 2014 at 6:00 PM 
Hi! I tried this script but I found a lack of information in the docs. After running the script what is supposed to happen?

This are the results
:: Applying patch...
patching file `ddl/mssql_sql_generator.php'
Hunk #1 succeeded at 549 with fuzz 2 (offset 36 lines).
Hunk #2 FAILED at 576.
Hunk #3 succeeded at 571 (offset -37 lines).
Hunk #4 succeeded at 652 (offset 36 lines).
1 out of 4 hunks FAILED -- saving rejects to ddl/mssql_sql_generator.php.rej
patching file `installlib.php'
patching file `setup.php'
Hunk #1 succeeded at 135 (offset 77 lines).
patching file `setuplib.php'
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
3 out of 3 hunks ignored -- saving rejects to setuplib.php.rej
1 archivo(s) copiado(s).