moodle-plugin-ci
moodle-plugin-ci copied to clipboard
Ability to use the moodle-plugin-ci inside a existing Moodle repository
Hello, This PR add the ability to use this plugin inside a full Moodle repository and test multiple plugins already present in the repository (provided as submodules for example).
It means that the installation command will not clone the Moodle repository but use an existing local folder instead. And that the plugins are not "copied" inside Moodle directory as they are already there.
Installation has a new option called no-clone.
/tmp/bin/moodle-plugin-ci --no-clone --moodle /var/www/moodle --db-type=$DB_TYPE
The user must then specify the command to run and the full plugin directory:
/tmp/bin/moodle-plugin-ci ${command} /var/www/moodle/${plugin}
I also added an environment variable check called NPM_SUDO that add a sudo to run the command npm install -g --no-progress grunt. This was needed as a global installation may require sudo privileges (locally or on Gitlab-Ci for example).
Note that I refactored a lot, mainly to allow VendorInstaller and TestSuiteInstaller to be executed on more than one plugin.
It's the first time that I contribute on the project. Any suggestion are welcomed.
Thanks,
You can find a demo on how we use the moodle-plugin-ci here: https://github.com/liip-elearning/moodle-ci/blob/master/moodle-plugin-ci.dist.sh