Show Menu
Cheatography

Moodle MDK Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Creating a new instance

mdk create
-i
launch the instal­lation script after creating the instance
-e engine
database engine to install the instance on, use with -i (default: mysqli)
-t
create an instance from integr­ation
-r [run [run ...]]
scripts to run after instal­lation
-n name
use this identifier instead of generating one. The flag --suffix will be used. Do not use when creating multiple versions at once.
-s [suffix [suffix ...]]
suffixes for the instance name
-v [version [version ...]]
version of Moodle (default: ['mast­er'])
usage: mdk create [-h] [-i] [-e engine] [-t] [-r [run [run ...]]] [-n name]
[-s [suffix [suffix ...]]] [-v [version [version ...]]]

Example: mdk create -v 30 -i -e pgsql -r dev

Fixing an issue

mdk fix
--autofix
auto fix the bug related to the issue number
-n name
name of the instance (default: None)
usage: mdk fix [-h] [--aut­ofix] [-n name] issue [suffix]

Example: mdk fix 12345

Updating your Moodle instances

mdk update
-a, -all
update each instance
-u, --upgrade
upgrade the instance after successful update
-c, --cached
only update the cached (mirrored) reposi­tories
-i, --inte­gration
update integr­ation instances
-s, --stable
update stable instances
usage: mdk update [-h] [-a] [-c] [-i] [-s] [-u] [names [names ...]]

Example: mdk update --all --upgrade
 

Backpo­rting a patch

mdk backport
-b branch
the branch to backport if not the current one.
-f
force the push
-i
backport to integr­ation instances
-p
push the branch after successful backport
--push-to remote
the remote to push the branch to. Default is github.
--patch
instead of pushing to a remote, this will upload a patch file to the tracker. Security issues use this by default if --push is set. This option discards most other flags.
-t [gitref]
to use with --push, also add the diff inform­ation to the tracker issue
-v version [versi­on...]
versions to backport to (default: None)
[name]
name of the instance to backport from.
usage: mdk backport [-h] [-b branch] [-f] [-i] [-p] [--push-to remote]
[--patch] [-t [gitref]] -v version [version ...]
[name]

Example: mdk backport -v 31 32 -p -t