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 /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

Vakaraitaka na vakasama/rai kece
  • 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