From 7be928e0b16d0a1383508a773635f2c43f05ba88 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Tue, 22 Jul 2014 11:35:32 +0800 Subject: [PATCH] Reformating from markdown to reStructuredText --- CHANGELOG.md | 116 --------------------------------- CHANGELOG.rst | 116 +++++++++++++++++++++++++++++++++ README.md => README.rst | 118 ++++++++++++++++++++++++++++------ mdk/scripts/{README.md => README.rst} | 2 +- 4 files changed, 215 insertions(+), 137 deletions(-) delete mode 100644 CHANGELOG.md create mode 100644 CHANGELOG.rst rename README.md => README.rst (83%) rename mdk/scripts/{README.md => README.rst} (90%) diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 1e0101d..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,116 +0,0 @@ -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 diff --git a/CHANGELOG.rst b/CHANGELOG.rst new file mode 100644 index 0000000..9a16466 --- /dev/null +++ b/CHANGELOG.rst @@ -0,0 +1,116 @@ +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 diff --git a/README.md b/README.rst similarity index 83% rename from README.md rename to README.rst index d70cc0a..c376112 100644 --- a/README.md +++ b/README.rst @@ -16,15 +16,15 @@ Most of the tools work on Moodle 1.9 onwards, but some CLI scripts required by M Usage ===== -The commands are called using that form: +The commands are called using that form:: mdk -Get some help on a command using: +Get some help on a command using:: mdk --help -Also check the [wiki](https://github.com/FMCorz/mdk/wiki). +Also check the `wiki `_. Installation ============ @@ -32,7 +32,9 @@ 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 @@ -43,40 +45,50 @@ _This method is currently not recommended, the package is outdated. Maintainer w 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 `_, please refer to this `formula `_. 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 `_ 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 @@ -86,6 +98,8 @@ Assuming that you are using Apache, which is set up to serve the files from /var 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 @@ -102,7 +116,9 @@ Set up aliases of your Moodle commands. **Example** This line defines the alias 'upall', for 'moodle update --all' - + +:: + mdk alias add upall "update --all" backport @@ -114,10 +130,14 @@ Backport a branch to another instance of Moodle. 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 @@ -129,14 +149,20 @@ Backup a whole instance so that it can be restored later. 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 @@ -147,6 +173,8 @@ Get the instance ready for acceptance testing (Behat), and run the test feature( **Examples** +:: + mdk behat -r --tags=@core_completion @@ -159,10 +187,14 @@ Create a new instance of Moodle. It will be named according to your config file. 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 @@ -173,10 +205,14 @@ Set your MDK settings from the command line. **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 @@ -190,6 +226,8 @@ CSS related functions. Compile the LESS files from Bootstrapbase +:: + mdk css --compile @@ -208,6 +246,8 @@ Create a branch from an issue number on the tracker (MDL-12345) and sets it to t 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 @@ -221,10 +261,14 @@ Display information about the instances on the system. List the instances +:: + mdk info --list Display the information known about the instance *stable_master* +:: + mdk info stable_master @@ -235,6 +279,8 @@ Run the command line installation script with all parameters set on an existing **Examples** +:: + mdk install --engine mysqli stable_master @@ -247,6 +293,8 @@ JS related functions. Compile the JS modules in Atto +:: + mdk js shift --plugin editor_atto @@ -257,6 +305,8 @@ Get the instance ready for PHPUnit tests, and run the test(s). **Examples** +:: + mdk phpunit -u repository/tests/repository_test.php @@ -267,6 +317,8 @@ Look for a plugin on moodle.org and downloads it into your instance. **Example** +:: + mdk plugin download repository_evernote @@ -279,6 +331,8 @@ Purge the cache. To purge the cache of all the instances +:: + mdk purge --all @@ -291,6 +345,8 @@ Pulls a patch using the information from a tracker issue. 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 @@ -303,10 +359,14 @@ Shortcut to push a branch to your remote. 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 @@ -319,6 +379,8 @@ Fetch the latest branches from the upstream remote and rebase your local branche 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 @@ -330,6 +392,8 @@ Remove an instance, deleting every thing including the database. **Example** +:: + mdk remove stable_master @@ -342,6 +406,8 @@ Execute a script on an instance. The scripts are stored in the scripts directory Set the instance stable_master ready for development +:: + mdk run dev stable_master @@ -352,6 +418,8 @@ Gets some information about the issue on the tracker. **Example** +:: + $ mdk tracker 34543 ------------------------------------------------------------------------ MDL-34543: New assignment module - Feedback file exists for an @@ -382,10 +450,14 @@ Fetch the latest stables branches from the upstream remote and pull the changes 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 @@ -398,16 +470,22 @@ Run the upgrade script of your instance. 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 @@ -424,13 +502,13 @@ Shipped scripts 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 `_ diff --git a/mdk/scripts/README.md b/mdk/scripts/README.rst similarity index 90% rename from mdk/scripts/README.md rename to mdk/scripts/README.rst index ba4cd29..ade1e47 100644 --- a/mdk/scripts/README.md +++ b/mdk/scripts/README.rst @@ -1,7 +1,7 @@ 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. -- 2.11.0