2024-10-30 20:26:28 +01:00

3.2 KiB

Contributing

Making changes

Currently, this repo pushes a tagged image from main to the packages tab each time main is updated. As such, if you're proposing a change, please update the following files in a PR and DO NOT push directly to main.

  1. Bump the version number in the config.json file
  2. Make whatever changes you need (e.g., bumping the version of Node Exporter or the version of the base images)
  3. Add your changes to the CHANGELOG.md file

Testing

I'm still working this out, but am doing testing based on this page.

After making your changes, run the command below from the git root directory (i.e., hassos-addons) to ensure that the add-on builds successfully (substitute amd64 with armhf, aarch64, or i386 based on your system).

docker run \
  --rm \
  -it \
  --name builder \
  --privileged \
  -v ./prometheus_node_exporter:/data \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  ghcr.io/home-assistant/amd64-builder \
  -t /data \
  --amd64 \
  --test \
  -i test-prometheus-node-exporter \
  -d local

To test that the add-on actually runs, I've been using my personal instance of Home Assistant 🤷‍♂️

  1. Open the Add-ons panel in Home Assistant by going to Settings-->Add-ons-->Add-on Store
  2. Uninstall the current Prometheus Node Exporter add-on (the one published from GHCR.io)
  3. Install the official samba add-on
  4. Enable samba with a username and password
  5. Mount the samba share locally (e.g., Dolphin can use smb://your_home_assistant_ip_address)
  6. Navigate to the addons directory in the samba share
  7. Copy/paste the entire prometheus_node_exporter directory to the addons directory in the samba share
  8. In the config.json file in the samba share, remove this entire line
    "image": "ghcr.io/loganmarchione/hassos-addons/prometheusnodeexporter-{arch}",
    
  9. Open the Add-ons panel in Home Assistant by going to Settings-->Add-ons-->Add-on Store
  10. Click the menu icon in the top-right, then click "Check for updates"
  11. Refresh the page
  12. At the very top, there should be a new section for "Local add-ons" with the "Prometheus Node Exporter" to install
  13. Install the new add-on from the local repository
    1. Test all configurations
    2. Make sure log entries line up with configuration settings
    3. Navigate to http://your_home_assistant_ip_address:9100/metrics and ensure that HTTP basic auth works as expected
  14. Stop and uninstall the local add-on
  15. Delete the entire prometheus_node_exporter directory in the addons directory in the samba share
  16. Disable the samba add-on
  17. Re-install add-on from GHCR.io (you'll need to re-configure the add-on)