Moodle Plugins directory: gitplugins | Moodle.org

gitplugins
Utilities
Maintained by
Guillaume Allègre
A cli administration tool to help deploying Moodle plugins via Git
Latest release:
4 downloads
11 fans
Current versions available: 1
gitplugins is a very light (single file) administration tool to help deploying Moodle plugins via Git.
You need to install one single file in the
You need to install one single file in the
/admin/cli/
directory, the gitplugins.php
script.The gitplugins.conf
file is a list of all the plugins you want to manage (install, upgrade...) with the format:
'local/mailtest' => [
'path' => '/local/mailtest', // mandatory ; path from the moodle root
'gitrepository' => 'https://github.com/michael-milette/moodle-local_mailtest', // mandatory
'gitbranch' => '', // optional ; git branch (incompatible with gitrevision)
'gitrevision' => '', // optional ; precise git revision (hash or tag) (incompatible with gitbranch)
],
You can then launch php gitplugins.php
with one of the options:
--gen-config
generates a sample gitplugins.conf file--check
checks the consistency of 'gitplugins.conf'--diag
displays a diagnostic of all declared plugins--status
launches agit status
on each declared plugin--install
installs all plugins that are not already present (git clone
)--upgrade
upgrades all plugins already installed (git fetch
+git checkout
)--cleanup
"removes" all plugins in an inconsistent state (by renaming them, so restoration is possible)--gen-exclude
generates a chunk of lines to insert in your.git/info/exclude
file
"Cleaned" repositories are renamed to <orig-name>.back-<timestam>
, so you can easily find and restore them if needed.
Useful links
Contributors
Guillaume Allègre (Lead maintainer)
Please login to view contributors details and/or to contact them
distinction --install / --install-all and --upgrade / --upgrade-all
--install-all installs all plugins that are not already present
--install= installs this plugin according to gitplugins.conf
--upgrade-all upgrades all plugins already installed
--upgrade= upgrades this plugin according to gitplugins.conf
* minor bugfixes and enhancements
* self-executable from unix cli (/usr/bin/env php)
* no need to load the main config.php anymore, so no permission troubles
* --list displays a compact list of all declared plugins
* gitplugins --status-all displays a summary of modified files at the end of the command
Some conventions have changed : you must define an environment variable MOODLE_ROOT and the config and log files are hidden files, located in the moodle root.
So you can "install" one single `gitp.phar` to manage several instances.
All the details are available in the github repository, README.md.