Contribute Code
You can contribute code to the OpenNMS Plugin for Grafana project via GitHub. This section describes the codebase and how to prepare your development environment.
Codebase
Plugin development is done in the project’s default GitHub branch (develop).
Commits are automatically compiled, tested, and merged to the master branch.
Releases are tagged from the master branch and submitted to the Grafana plugin repository.
Prepare development environment
Follow these steps to prepare your development environment:
-
Edit
grafana.iniand configure it to allow unsigned plugin development:app_mode = development ... [plugins] allow_loading_unsigned_plugins = opennms-opennms-app -
Use Git to check out the repository:
git clone https://github.com/OpenNMS/grafana-plugin.git opennms-grafana-plugin -
Navigate to your plugin directory:
cd opennnms-grafana-plugin -
Install the build and runtime dependencies:
npm ci -
Build the plugin to prime your
distdirectory:npm run dev -
Symlink your
distdirectory to Grafana’s plugin path:ln -s /path/to/opennms-grafana-plugin/dist /var/lib/grafana/plugins/opennms-opennms-app -
Run a continuous build that watches for changes:
npm run watchAfter you save a change to the plugin, refresh Grafana to load the updates.