Since both Rundeck and Nomad are fast-evolving projects, work will need to be done to keep the plugin up-to-date. An important part of that is maintaining good coverage of driver functionality. Drivers are implemented as separate plugin classes shipped in the same jar, however, they share a lot of logic and inherit from the same class. Adding a new driver amounts to defining input fields in the UI and mapping them onto the driver-specific configuration keys in the job definition. An outline of a new driver implementation is given below.
To add support for a new task driver, for example raw_exec
driver, follow these steps
- Create a subpackage e.g.
io.github.valfadeev.rundeck_nomad_plugin.driver.rawexec
and implementRawExecPropertyComposer
(for UI fields) andRawExecTaskConfigProvider
(for mapping onto task configuration). Please maintain the naming convention, because the plugin base class uses reflection to load the driver-specific classes. Using constants for configuration option keys is not necessary, but is highly recommended for easier debugging and refactoring. - Add new value to
SupportedDrivers
- Create new class
NomadRawExecStepPlugin
in the package root extendingNomadStepPlugin
and annotate it with@Plugin
,@PluginDescription
and@Driver
. Define static fieldSERVICE_PROVIDER_NAME
. Rely on theNomadDockerStepPlugin
as the example. - Add the fully qualified class name to
ext.pluginClassNames
inbuild.gradle
. - Add tests
- Build the project and verify that all plugins are correctly loaded by Rundeck.