Module Deployment Process
For years, modules have been included into the core of MunkiReport. It has lowered the bar for admins to simply install and have things work, but it has slowed development of both the core and modules as the complexity and pace of development has risen. Adding custom modules has always been possible, but decoupling modules from the core truly allows us to have a supported workflow for adding and updating modules outside of the MunkiReport repo.
The process outlined below may not be for everyone. It is not a prereq to creating your own modules. Some may find in useful in certain situations, but it is by no means necessary!
Composer is a dependency manager for PHP.
We don’t really have to worry about this at the moment. MunkiReport uses it in the background. Occasionally we need to run
composer, but we’ll discuss that later.
First of all, if you don’t have an account, go make one. Modules are now separated into their own dedicated repo. Simple enough to do:
Create the repository sans readme and license and then run:
git init git add . git commit -m "First commit" git remote add origin https://github.com/IsabellaCommunitySportsplex/awesome.git git push -u origin master
Once the module is functional we will create a release for this module:
Packagist is the main Composer repository. To add our release to Packagist, submit the package here: https://packagist.org/packages/submit
Add the link to the GitHub repo in the Repository URL and click submit. You may see this:
Oh noes! Will I actually have to talk to Bochoven?! Well, if you want it to be part of the MunkiReport repositories, yes. But luckily, we just need to change this line in our
composer.json file for the repo:
To our namespace:
Once you check again, you may get a warning that your package has a similar name to another package, and if you’re ok with that just continue. It will do more magic and you will see this:
Once we add our release to Packagist we are able to require our module by running the following command to add it to our
COMPOSER=composer.local.json composer require joncrain/awesome:^1.0