+++ /dev/null
-Changelog
-=========
-
-v1.2
-----
-
-* New `js` command
-
-v1.1
-----
-
-* Sub processes are killed when using CTRL + C
-* Default alias `theme` to set a theme - Andrew Nicols
-* `config` has a new sub command `edit`
-
-v1.0
-----
-
-* Dropped official support for Python 2.6
-* Moving forward by using `pip` for external dependencies
-* New command `css` for CSS related tasks
-* New script to `enrol` users
-* `push` and `backport` commands can upload patches to the tracker
-* `pull` can be forced to check for patches rather than pull branches
-* Command `check` was renamed `doctor`
-* `doctor` can check for dependencies
-* Support for sourcemaps when compiling LESS - Andrew Nicols
-* Exit with error code 1 when an exception is thrown
-* `run` can pass arguments to scripts
-* Faster clone of cache on first `init`
-* `phpunit` accepts a testcase as argument
-* `.noupgrade` file can be used not to upgrade an instance
-* `behat` can run tests by name - Andrew Nicols
-* `remove` accepts `-f` as an argument - Andrew Nicols
-* The script `less` is deprecated
-* `backport` command resolves conflicts with CSS from LESS in theme_bootstrapbase
-
-v0.5
-----
-
-* New command `uninstall` to uninstall an instance
-* New command `plugin` to install plugins
-* `push` and `backport` can specify the HEAD commit when updating the tracker
-* Updating the tracker smartly guesses the HEAD commit
-* `behat` can force the download of the latest Selenium
-* New setting not to use the cache repositories as remote
-* `purge` can manually purge cache without using the shipped CLI
-
-v0.4.2
-------
-
-* Updating tracker issue uses short hashes
-* `create` accepts a custom instance identifier
-* More verbose `dev` script
-* New script `undev` to revert the changes of the script `dev`
-* `pull` has an option to fetch only
-* New script `less` to compile the less files from bootstrapbase
-* `run` can execute shell scripts
-* Auto complete for `behat` -f
-* Auto complete for `phpunit` -u
-* Shipping a bash script `extra/goto_instance` to jump to instances with auto complete
-
-v0.4.1
-------
-
-* `config` can display objects (eg. `mdk config show wording`)
-* `config` output is ordered alphabetically
-* `info` output is ordered alphabetically
-* `init` does not show the default password between brackets
-* `init` does not fail because of missing directories
-* `run` was permanently failing
-* `tracker` failed when an issue was unassigned
-
-v0.4
-----
-
-* New command `tracker` to fetch information from the tracker
-* `alias` support arguments for bash aliases
-* `alias` can update aliases
-* `backport` works locally
-* `backport` can update tracker Git info
-* `behat` can limit features to test
-* `behat` can disable itself
-* `check` can fix problems
-* `check` checks remote URLs
-* `check` checks $CFG->wwwroot
-* `check` checks the branch checked out on integration instances
-* `create` accepts multiple versions
-* `create` accepts multiple suffixes
-* `phpunit` can limit testing to one file
-* `pull` can download patch from the tracker
-* `pull` can checkout the remote branch
-* `push` checks that the branch and MDL in commit message match
-* `rebase` can update tracker Git info
-* `run` can list the available scripts
-* Cached repositories are mirrors
-* Removed use of Bash script to launch commands
-* Deprecated moodle-*.py files
-* Instances can be installed on https
-* Improved debugging
-
-
-v0.3
-----
-
-* New command `behat` which is equivalent to `phpunit`
-* New command `pull` to fetch a patch from a tracker issue
-* New script `webservices` to entirely enable the web services
-* `push` now updates the Git information on the tracker issue (Thanks to Damyon Wiese)
-* `phpunit` can also run the tests after initialising the environment
-* `update --update-cache` can proceed with the updates after updating the cached remotes
-* `info` can be used to edit settings ($CFG properties) in config.php
-* `init` has been a bit simplified
-* Basic support of shell commands in aliases
-* The settings in config.json are read from different locations, any missing setting will be read from config-dist.json
-* Bug fixes
--- /dev/null
+Changelog
+=========
+
+v1.2
+----
+
+- New ``js`` command
+
+v1.1
+----
+
+- Sub processes are killed when using CTRL + C
+- Default alias ``theme`` to set a theme - Andrew Nicols
+- ``config`` has a new sub command ``edit``
+
+v1.0
+----
+
+- Dropped official support for Python 2.6
+- Moving forward by using ``pip`` for external dependencies
+- New command ``css`` for CSS related tasks
+- New script to ``enrol`` users
+- ``push`` and ``backport`` commands can upload patches to the tracker
+- ``pull`` can be forced to check for patches rather than pull branches
+- Command ``check`` was renamed ``doctor``
+- ``doctor`` can check for dependencies
+- Support for sourcemaps when compiling LESS - Andrew Nicols
+- Exit with error code 1 when an exception is thrown
+- ``run`` can pass arguments to scripts
+- Faster clone of cache on first ``init``
+- ``phpunit`` accepts a testcase as argument
+- ``.noupgrade`` file can be used not to upgrade an instance
+- ``behat`` can run tests by name - Andrew Nicols
+- ``remove`` accepts ``-f`` as an argument - Andrew Nicols
+- The script ``less`` is deprecated
+- ``backport`` command resolves conflicts with CSS from LESS in theme_bootstrapbase
+
+v0.5
+----
+
+- New command ``uninstall`` to uninstall an instance
+- New command ``plugin`` to install plugins
+- ``push`` and ``backport`` can specify the HEAD commit when updating the tracker
+- Updating the tracker smartly guesses the HEAD commit
+- ``behat`` can force the download of the latest Selenium
+- New setting not to use the cache repositories as remote
+- ``purge`` can manually purge cache without using the shipped CLI
+
+v0.4.2
+------
+
+- Updating tracker issue uses short hashes
+- ``create`` accepts a custom instance identifier
+- More verbose ``dev`` script
+- New script ``undev`` to revert the changes of the script ``dev``
+- ``pull`` has an option to fetch only
+- New script ``less`` to compile the less files from bootstrapbase
+- ``run`` can execute shell scripts
+- Auto complete for ``behat`` -f
+- Auto complete for ``phpunit`` -u
+- Shipping a bash script ``extra/goto_instance`` to jump to instances with auto complete
+
+v0.4.1
+------
+
+- ``config`` can display objects (eg. ``mdk config show wording``)
+- ``config`` output is ordered alphabetically
+- ``info`` output is ordered alphabetically
+- ``init`` does not show the default password between brackets
+- ``init`` does not fail because of missing directories
+- ``run`` was permanently failing
+- ``tracker`` failed when an issue was unassigned
+
+v0.4
+----
+
+- New command ``tracker`` to fetch information from the tracker
+- ``alias`` support arguments for bash aliases
+- ``alias`` can update aliases
+- ``backport`` works locally
+- ``backport`` can update tracker Git info
+- ``behat`` can limit features to test
+- ``behat`` can disable itself
+- ``check`` can fix problems
+- ``check`` checks remote URLs
+- ``check`` checks $CFG->wwwroot
+- ``check`` checks the branch checked out on integration instances
+- ``create`` accepts multiple versions
+- ``create`` accepts multiple suffixes
+- ``phpunit`` can limit testing to one file
+- ``pull`` can download patch from the tracker
+- ``pull`` can checkout the remote branch
+- ``push`` checks that the branch and MDL in commit message match
+- ``rebase`` can update tracker Git info
+- ``run`` can list the available scripts
+- Cached repositories are mirrors
+- Removed use of Bash script to launch commands
+- Deprecated moodle-*.py files
+- Instances can be installed on https
+- Improved debugging
+
+
+v0.3
+----
+
+- New command ``behat`` which is equivalent to ``phpunit``
+- New command ``pull`` to fetch a patch from a tracker issue
+- New script ``webservices`` to entirely enable the web services
+- ``push`` now updates the Git information on the tracker issue (Thanks to Damyon Wiese)
+- ``phpunit`` can also run the tests after initialising the environment
+- ``update --update-cache`` can proceed with the updates after updating the cached remotes
+- ``info`` can be used to edit settings ($CFG properties) in config.php
+- ``init`` has been a bit simplified
+- Basic support of shell commands in aliases
+- The settings in config.json are read from different locations, any missing setting will be read from config-dist.json
+- Bug fixes
Usage
=====
-The commands are called using that form:
+The commands are called using that form::
mdk <command> <arguments>
-Get some help on a command using:
+Get some help on a command using::
mdk <command> --help
-Also check the [wiki](https://github.com/FMCorz/mdk/wiki).
+Also check the `wiki <https://github.com/FMCorz/mdk/wiki>`_.
Installation
============
Ubuntu package
--------------
-_This method is currently not recommended, the package is outdated. Maintainer wanted!_
+*This method is currently not recommended, the package is outdated. Maintainer wanted!*
+
+::
sudo apt-add-repository ppa:2x1cq-fred-7nqa6/ppa
sudo apt-get update
sudo su `whoami`
You're done!
-Try the following command to create a typical Stable Master instance (this will take some time because the cache is still empty):
+Try the following command to create a typical Stable Master instance (this will take some time because the cache is still empty)
+
+::
mdk create
mdk list
-Now you should be able to access it from http://moodle-sdk/stable_master.
+Now you should be able to access it from ``http://moodle-sdk/stable_master``.
Mac OS
------
-Using [Homebrew](http://brew.sh/), please refer to this [formula](https://github.com/danpoltawski/homebrew-mdk).
+Using `Homebrew <http://brew.sh/>`_, please refer to this `formula <https://github.com/danpoltawski/homebrew-mdk>`_.
Manual installation
-------------------
### 1. Clone the repository
+::
+
cd /opt
sudo git clone git://github.com/FMCorz/mdk.git moodle-sdk
### 2. Install the dependencies
-You will need the tool [pip](http://www.pip-installer.org/en/latest/installing.html) to install the packages required by Python.
+You will need the tool `pip <http://www.pip-installer.org/en/latest/installing.html>`_ to install the packages required by Python.
+
+::
sudo pip install -r /opt/moodle-sdk/requirements.txt
-### 3. Make executable and accessible
+### 3. Make executable and accessible::
+
+::
sudo chmod +x /opt/moodle-sdk/mdk.py
sudo ln -s /opt/moodle-sdk/mdk.py /usr/local/bin/mdk
### 4. Set up the basics
-Assuming that you are using Apache, which is set up to serve the files from /var/www, leave the default values as they are in `mdk init`, except for your remote and the database passwords.
+Assuming that you are using Apache, which is set up to serve the files from /var/www, leave the default values as they are in ``mdk init``, except for your remote and the database passwords.
+
+::
mkdir ~/www
sudo ln -s ~/www /var/www/m
Try the following command to create a typical Stable Master instance (this will take some time because the cache is still empty):
+::
+
mdk create
mdk list
**Example**
This line defines the alias 'upall', for 'moodle update --all'
-
+
+::
+
mdk alias add upall "update --all"
backport
Assuming we are in a Moodle instance, this backports the current branch to the version 2.2 and 2.3
+::
+
mdk backport --version 22 23
Backports the branch MDL-12345-23 from the instance stable_23 to the instance stable_22, and pushes the new branch to your remote
+::
+
mdk backport stable_23 --branch MDL-12345-23 --version 22 --push
backup
Backup the instance named stable_master
+::
+
mdk backup stable_master
List the backups
+::
+
mdk backup --list
Restore the second backup of the instance stable_master
+::
+
mdk backup --restore stable_master_02
**Examples**
+::
+
mdk behat -r --tags=@core_completion
Create a new instance of Moodle 2.1
+::
+
mdk create --version 21
Create an instance of Moodle 2.2 using PostgreSQL from the integration remote, and run the installation script.
+::
+
mdk create --version 22 --engine pgsql --integration --install
config
**Examples**
Show the list of your settings
-
+
+::
+
mdk config list
-Change the value of the setting 'dirs.storage' to '/var/www/repositories'
+Change the value of the setting ``dirs.storage`` to ``/var/www/repositories``
+
+::
mdk config set dirs.storage /var/www/repositories
Compile the LESS files from Bootstrapbase
+::
+
mdk css --compile
In a Moodle 2.2 instance, this will create (and checkout) a branch named MDL-12345-22 which will track upstream/MOODLE_22_STABLE.
+::
+
mdk fix MDL-12345
mdk fix 12345
List the instances
+::
+
mdk info --list
Display the information known about the instance *stable_master*
+::
+
mdk info stable_master
**Examples**
+::
+
mdk install --engine mysqli stable_master
Compile the JS modules in Atto
+::
+
mdk js shift --plugin editor_atto
**Examples**
+::
+
mdk phpunit -u repository/tests/repository_test.php
**Example**
+::
+
mdk plugin download repository_evernote
To purge the cache of all the instances
+::
+
mdk purge --all
Assuming we type that command on a 2.3 instance, pulls the corresponding patch from the issue MDL-12345 in a testing branch
+::
+
mdk pull --testing 12345
Push the current branch to your repository
+::
+
mdk push
Force a push of the branch MDL-12345-22 from the instance stable_22 to your remote
+::
+
mdk push --force --branch MDL-12345-22 stable_22
This will rebase the branches MDL-12345-xx and MDL-56789-xx on the instances stable_22, stable_23 and stable_master. And push them to your remote if successful.
+::
+
mdk rebase --issues 12345 56789 --version 22 23 master --push
mdk rebase --issues MDL-12345 MDL-56789 --push stable_22 stable_23 stable_master
**Example**
+::
+
mdk remove stable_master
Set the instance stable_master ready for development
+::
+
mdk run dev stable_master
**Example**
+::
+
$ mdk tracker 34543
------------------------------------------------------------------------
MDL-34543: New assignment module - Feedback file exists for an
This updates the instances stable_22 and stable_23
+::
+
mdk update stable_22 stable_23
This updates all your integration instances and runs the upgrade script of Moodle.
+::
+
mdk update --integration --upgrade
The following runs an upgrade on your stable branches
+::
+
mdk upgrade --stable
This will run an update an each instance before performing the upgrade process
+::
+
mdk upgrade --all --update
Scripts
=======
-You can write custom scripts and execute them on your instances using the command `mdk run`. MDK looks for the scripts in the _scripts_ directories and identifies their type by reading their extension. For example, a script called 'helloworld.php' will be executed as a command line script from the root of an installation.
+You can write custom scripts and execute them on your instances using the command ``mdk run``. MDK looks for the scripts in the *scripts* directories and identifies their type by reading their extension. For example, a script called 'helloworld.php' will be executed as a command line script from the root of an installation.
+
+::
# From anywhere on the system
$ mdk run helloworld stable_master
The following scripts are available with MDK:
-* `dev`: Changes a portion of Moodle settings to enable development mode
-* `enrol`: Enrols users in any existing course
-* `undev`: Reverts the changes made by `dev`
-* `users`: Creates a set of users
-* `webservices`: Does all the set up of webservices for you
+* ``dev``: Changes a portion of Moodle settings to enable development mode
+* ``enrol``: Enrols users in any existing course
+* ``undev``: Reverts the changes made by ``dev``
+* ``users``: Creates a set of users
+* ``webservices``: Does all the set up of webservices for you
License
=======
-Licensed under the [GNU GPL License](http://www.gnu.org/copyleft/gpl.html)
+Licensed under the `GNU GPL License <http://www.gnu.org/copyleft/gpl.html>`_
Custom scripts
==============
-This directory is meant to host scripts to be run on an instance. They are called using the command `run`.
+This directory is meant to host scripts to be run on an instance. They are called using the command ``run``.
The format of the script is recognised using its extension.