Keep component boilerplate in sync
The creation of a new Commodore component yield several boilerplate files. Some of those files are meant to be altered by a component author. Others should be equal throughout all components managed by Project Syn. As with all code, things will change. As a result, components will drift apart over time. To battle this issue, we make use of ModuleSync to keep that boilerplate in sync. The template repository for Project Syn is located at modulesync-control.
ModuleSync allows to have a set of templates in a control repository. Those templates then can be applied to several other repositories. Originally, ModuleSync was written for Puppet Modules. We’ve found, that this tool also fits our needs for Commodore components.
The templates are located in the folder
Each templates takes a set of variables as input which are defined in a file.
In the control repository the variables are defined in
In the component they’re located in
Changes in the control repository pushed to
master will trigger the execution of ModuleSync.
A pull request will be created for each managed component.
That’s, if there are changes in the component.
Variables defined in
config_defaults.yml in the control repository can be overwritten in
.sync.yml within a component.
The merge behaviour is different to the one used within the Project Syn configuration hierarchy.
If a key is overwritten in the module, it will overwrite the whole
A component created with
commodore component create will be ready to be managed by
modulesync-control of Project Syn.
In order for this to happen, you have to add your component to managed_modules.yml.
Components kept in sync by modulesync-control must adhere to some rules.
Don’t edit the following files:
If you need to add new make targets, you can add them to new custom Makefiles (suggested file ending
.mk). You can include them in
Makefileby adding them to the list variable
If you have more things to exclude, add them to