gitplugins

Utilities
Maintained by Guillaume Allègre
A cli administration tool to help deploying Moodle plugins via Git
Latest release:
4 downloads
11 fans
Moodle 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5
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 /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 a git 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.



Screenshots

Screenshot #0

Contributors

Guillaume Allègre (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Plugins bot
    Wed, 25 Oct 2017, 3:30 AM
    Approval issue created: CONTRIB-7094
  • Guillaume Allègre
    Wed, 16 Oct 2019, 5:38 AM
    New in version 1.4.0 (see https://github.com/silecs/moodle-gitplugins/commits/1.4) :
    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
  • Guillaume Allègre
    Tue, 16 June 2020, 5:56 PM
    New in version 1.5.0 (https://github.com/silecs/moodle-gitplugins/commits/1.5):

    * 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
  • Guillaume Allègre
    Fri, 4 Dec 2020, 10:21 PM
    New in version 1.5.3 :
    * gitplugins --status-all displays a summary of modified files at the end of the command
  • Guillaume Allègre
    Tue, 10 Dec 2024, 1:51 AM
    I have rewritten gitplugins as a Phar file `gitp.phar`essentially for ease of maintenance.
    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.
Please login to post comments