From 7b9b85776b9bb187ba4d0aecb88ef4539cd59da3 Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 16 Sep 2026 09:02:15 +0200 Subject: [PATCH] Document pip install/update via git repo in README Adds instructions for installing and upgrading the plugin directly via pip from git.mrblake.cc, including pinning a ref, wiring it into local_requirements.txt for upgrade.sh, and the force-reinstall caveat needed to pick up updates from an unversioned git URL. Co-Authored-By: Claude Sonnet 5 --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index 84ab36e..c22c618 100644 --- a/README.md +++ b/README.md @@ -48,11 +48,36 @@ funktioniert weiter, und es landet eine Warnung im NetBox-Log. ## Installation +### Per pip direkt aus Git + +```bash +source /opt/netbox/venv/bin/activate +pip install git+https://git.mrblake.cc/MrBlake/NetBox-Concept.git +``` + +Für eine bestimmte Version oder einen Branch/Commit `@` anhängen, z.B.: + +```bash +pip install git+https://git.mrblake.cc/MrBlake/NetBox-Concept.git@v0.1.0 +``` + +Damit die Installation auch nach einem `upgrade.sh`/`python3 -m pip install -r +requirements.txt`-Lauf erhalten bleibt, den Eintrag zusätzlich in +`/opt/netbox/local_requirements.txt` aufnehmen: + +``` +git+https://git.mrblake.cc/MrBlake/NetBox-Concept.git +``` + +### Aus lokalem Checkout + ```bash source /opt/netbox/venv/bin/activate pip install /pfad/zu/netbox-rack-concept ``` +### Aktivieren + In `configuration.py`: ```python @@ -73,6 +98,22 @@ python manage.py collectstatic --no-input sudo systemctl restart netbox netbox-rq ``` +## Update + +```bash +source /opt/netbox/venv/bin/activate +pip install --upgrade --force-reinstall --no-deps git+https://git.mrblake.cc/MrBlake/NetBox-Concept.git +cd /opt/netbox/netbox +python manage.py migrate +python manage.py collectstatic --no-input +sudo systemctl restart netbox netbox-rq +``` + +`--force-reinstall --no-deps` ist nötig, weil pip bei einer git-URL ohne Versionsänderung +sonst annimmt, es sei nichts Neues zu holen. Wer stattdessen mit `local_requirements.txt` +und `upgrade.sh` arbeitet, bekommt Updates darüber automatisch mit, sobald sich der +referenzierte Branch/Tag ändert. + > Sollte `migrate` die mitgelieferte Migration nicht anwenden können, weil sich in eurer > NetBox-Installation Basisfelder unterscheiden: `netbox_rack_concept/migrations/0001_initial.py` > löschen und `python manage.py makemigrations netbox_rack_concept` laufen lassen.