WARNING: This is highly experimental! No guaranties whatsoever!
This Atomic Reactor plugin was born from the need of inspecting the workflow object accessible by plugins.
We also wanted to try functions provided by these plugins.
exit_inspect_plugins.py
and inspectors.py
should end up in the
plugins
directory of the atomic-reactor
installation in your buildroot.
For example one could add these lines to the Dockerfile of the buildroot:
ADD https://raw.githubusercontent.com/csomh/atomic-reactor-inspect-plugins/master/exit_inspect_plugins.py /usr/lib/python2.7/site-packages/atomic_reactor/plugins/exit_inspect_plugins.py
ADD https://raw.githubusercontent.com/csomh/atomic-reactor-inspect-plugins/master/inspectors.py /usr/lib/python2.7/site-packages/atomic_reactor/plugins/inspectors.py
Additional functions to inspect the workflow object can be added to inspectors.py
.
All functions will be attached to the plugin instance and will have access
to workflow
, log
and target
through self
.
Additionally all calls to the inspector functions will receive as a parameter
the plugin module they inspect. If there is no plugin module name requested,
the module parameter can be None
.
To enable the exit plugin for a build osbs-client can be configured to ask for this plugin to be run.
Example configuration placed in prod_inner.json
s exit plugin section:
{
"name": "inspect_plugins",
"required": false,
"args": {
"plugins": [
{
"name": "pre_reactor_config",
"inspect_funk": [
"get_config"
]
}
]
}
}
This will cause the plugin to import pre_reactor_config
plugin and pass it
to each inspector function specified in inspector_funk
.
The plugins
argument is a list, so one can specify multiple plugins to
inspect.