General developer forum

Install multiple plugins or smart way to upgrade

 
Wazza
Install multiple plugins or smart way to upgrade
Particularly helpful Moodlers

In following the manual on updating Moodle, I found it very time consuming to install all the plugins.

Is there a quicker way to do this?

I would think making a plugin directory in public_html/moodle/plugin and put all the plugins in there would make things a lot quicker?


Right now I'm just uploading the zip files one by one and installing them... through the web interface. Is that how it normally goes?

 
Average of ratings: -
Picture of Richard Oelmann
Re: Install multiple plugins or smart way to upgrade
Core developersParticularly helpful MoodlersPlugin developersTesters

I've done it different ways in the past

Keeping the plugins in a separate directory with a matching structure (themes, blocks, mods, folders etc) and copying from there. 

Right now, because I use git to manage them all, I have 2 scripts. One that installs all my plugins, so if I create a new test site I can run the script and pull everything in exactly the same. The other runs a git pull on all of them, and I've actually been testing putting that into cron on my development environment and seems to be have been fine. 

I know there are all sorts of dependency manager tools, but this simple script works exactly the way I want it to smile 

Richard (O) 

 
Average of ratings: -
Picture of Darko Miletić
Re: Install multiple plugins or smart way to upgrade
Core developersParticularly helpful Moodlers

You should look into scripting this.

For example for initial setup:

#!/bin/bash

BRANCHNAME='MOODLE_33_STABLE'
# Initial setup of Moodle
git clone https://github.com/moodle/moodle.git /path/to/moodle
git --git-dir="[/path/to/moodle]/.git/" --work-tree="[/path/to/moodle]" checkout -b "$BRANCHNAME" "origin/$BRANCHNAME"
# Initial setup of some plugin
git clone https://github.com/itamart/moodle-mod_dataform [/path/to/moodle]/mod/dataform
git --git-dir="[/path/to/moodle]/mod/dataform/.git/" --work-tree="[/path/to/moodle]/mod/dataform" checkout -b "$BRANCHNAME" "origin/$BRANCHNAME"

# install

cd /path/to/moodle
php admin/cli/install.php [various params]


And than for update:

#!/bin/bash

git --git-dir="[/path/to/moodle]/.git/" --work-tree="[/path/to/moodle]" pull
git --git-dir="[/path/to/moodle]/mod/dataform/.git/" --work-tree="[/path/to/moodle]/mod/dataform" pull

# upgrade
cd /path/to/moodle
php admin/cli/upgrade.php




 
Average of ratings: Useful (2)
Wazza
Re: Install multiple plugins or smart way to upgrade
Particularly helpful Moodlers

That's for upgrading Moodle right? But that's not my concern. Upgrading Moodle is quite easy, the problem is the many (custom) plugins that are installed.

 
Average of ratings: -
Picture of Darko Miletić
Re: Install multiple plugins or smart way to upgrade
Core developersParticularly helpful Moodlers

Please reread my message again focusing on the actual script examples. I gave you the response you asked for there.

 
Average of ratings: -