This is a project template for installing Moodle as a git submodule and all add-ons (plugins) as composer dependencies
This means that the Moodle core can also be managed as a git submodule, and all add-ons (plugins) can be managed with a single composer.json
file located in the project root.
Prerequisites are command line access to Git and Composer.
Change the your_project
in the following commands to the name of your project.
- Clone the template from git
git clone https://github.com/fedorsimakov/moodle-project your_project
(or use the repository as a template for a new repository) - Go to the cloned directory
cd your_project
- Change url "origin" repository to url of your repository
git remote set-url origin https://github.com/your_username/your_project
- Make a new project specific git branch
git checkout -b your_project-branch
- Set the desired branch to install Moodle in the
.gitmodules
file - Install Moodle core with
git submodule init
andgit submodule update --remote
- Install composer/installers package with
composer install
- Install the required plugins from the repository https://moodleplugarit.mmg.fi and the local repository (
local-repository
) using the commandcomposer require <vendor>/<plugin_name>
- Index all added and modified files
git add .
- Commit the changes to git
git commit -m "init your_project"
- Push the project to a git repository host
git push -u origin --all
The new project can now be duplicated to other environments