mitamae supports plugins for resources and recipes. Unlike Itamae, it's not achieved by gem or mrbgem.
It's dynamically loaded from ./plugins
directory searched from a working directory.
Note that this feature is experimental for now and load paths may be changed in the future.
By default, it loads plugin repositories under ./plugins
directory, based on a working directory of mitamae process.
If you put plugins in /path/to/plugins
, you can cd
to the directory which has plugins
.
cd /path/to
mitamae local ...
Since mitamae v1.10.1, you can also specify the plugins directory by a command line option.
mitamae local --plugins=/path/to/plugins ...
- Create a repository named
mitamae-plugin-resource-sample
oritamae-plugin-resource-sample
. - Implement
MItamae::Plugin::Resource::Sample
andMItamae::Plugin::ResourceExecutor::Sample
like mitamae's internal classes like mitamae's internal classes. Put sources inmitamae-plugin-resource-sample/mrblib/**/*.rb
. - Put it as git submodule to
./plugins/mitamae-plugin-resource-sample
oritamae-plugin-resource-sample
.
See itamae-plugin-resource-cask for example.
- Create a repository named
mitamae-plugin-recipe-sample
oritamae-plugin-recipe-sample
. - Write a recipe in
mitamae-plugin-recipe-sample/mrblib/mitamae/plugin/recipe/
.
- To
include_recipe 'sample'
, put a recipe tomitamae-plugin-recipe-sample/mrblib/mitamae/plugin/recipe/sample/default.rb
ormitamae-plugin-recipe-sample/mrblib/mitamae/plugin/recipe/sample.rb
. - To
include_recipe 'sample::example'
, put a recipe tomitamae-plugin-recipe-sample/mrblib/mitamae/plugin/recipe/sample/example.rb
.
- Put it as git submodule to
./plugins/mitamae-plugin-recipe-sample
oritamae-plugin-recipe-sample
.
See itamae-plugin-recipe-rbenv for example.