Permalink
e2c4c59 Nov 8, 2016
1 contributor

Users who have contributed to this file

26 lines (18 sloc) 1.57 KB

MItamae's plugin system

MItamae supports plugins for resources and recipes. Unlike Itamae, it's not achieved by gem or mrbgem. It's dynamically loaded from working directory you execute mitamae. Note that this feature is experimental for now and load paths may be changed in the future.

How to create and use plugin

Resource

  1. Create a repository named mitamae-plugin-resource-sample or itamae-plugin-resource-sample.
  2. Implement MItamae::Plugin::Resource::Sample and MItamae::Plugin::ResourceExecutor::Sample like MItamae's internal classes like MItamae's internal classes. Put sources in mitamae-plugin-resource-sample/mrblib/**/*.rb.
  3. Put it as git submodule to ./plugins/mitamae-plugin-resource-sample or itamae-plugin-resource-sample.

See itamae-plugin-resource-cask for example.

Recipe

  1. Create a repository named mitamae-plugin-recipe-sample or itamae-plugin-recipe-sample.
  2. Write a recipe in mitamae-plugin-recipe-sample/mrblib/mitamae/plugin/recipe/.
  • To include_recipe 'sample', put a recipe to mitamae-plugin-recipe-sample/mrblib/mitamae/plugin/recipe/sample/default.rb or mitamae-plugin-recipe-sample/mrblib/mitamae/plugin/recipe/sample.rb.
  • To include_recipe 'sample::example', put a recipe to mitamae-plugin-recipe-sample/mrblib/mitamae/plugin/recipe/sample/example.rb.
  1. Put it as git submodule to ./plugins/mitamae-plugin-recipe-sample or itamae-plugin-recipe-sample.

See itamae-plugin-recipe-rbenv for example.