Install Importarr from packaged repo build

This commit is contained in:
2026-07-29 13:07:39 +02:00
parent 0f7fc6f032
commit 6a7e83c1b6
4 changed files with 9 additions and 9 deletions
+4 -4
View File
@@ -3,7 +3,7 @@ PIP ?= .venv/bin/pip
SERVICE ?= importarr.service
LIVE_URL ?= http://127.0.0.1:8095
.PHONY: test install-systemd install-editable upgrade-local repo-upgrade verify-live
.PHONY: test install-systemd install-from-repo upgrade-local repo-upgrade verify-live
test:
$(PYTHON) -m pytest
@@ -11,11 +11,11 @@ test:
install-systemd:
sudo -n sh deploy/systemd-install.sh
install-editable:
sudo -n /opt/importarr/venv/bin/pip install --upgrade --editable /srv/opencode-workspace/importarr
install-from-repo:
sudo -n /opt/importarr/venv/bin/pip install --upgrade /srv/opencode-workspace/importarr
upgrade-local:
sudo -n /opt/importarr/venv/bin/pip install --upgrade --editable /srv/opencode-workspace/importarr
sudo -n /opt/importarr/venv/bin/pip install --upgrade /srv/opencode-workspace/importarr
sudo -n systemctl restart $(SERVICE)
repo-upgrade:
+3 -3
View File
@@ -33,7 +33,7 @@ sudo ${EDITOR:-vi} /etc/importarr/importarr.env
sudo systemctl start importarr.service
```
The installer creates the `importarr` system user when needed, installs a virtualenv at `/opt/importarr/venv`, and installs the package in editable mode from the checked-out repository. The repository is therefore the source of truth: pull or edit the repo, reinstall/restart from the repo, and the service runs that code.
The installer creates the `importarr` system user when needed, installs a virtualenv at `/opt/importarr/venv`, and installs the package from the checked-out repository. The repository is therefore the source of truth: pull or edit the repo, reinstall/restart from the repo, and the service runs the package built from that code.
For local upgrades from a checked-out repo on dgsserver1, use the repo workflow instead of editing live scripts:
@@ -41,7 +41,7 @@ For local upgrades from a checked-out repo on dgsserver1, use the repo workflow
cd /srv/opencode-workspace/importarr
.venv/bin/python -m pytest
git status --short --branch
sudo -n /opt/importarr/venv/bin/pip install --upgrade --editable /srv/opencode-workspace/importarr
sudo -n /opt/importarr/venv/bin/pip install --upgrade /srv/opencode-workspace/importarr
sudo -n systemctl restart importarr.service
make verify-live
```
@@ -52,7 +52,7 @@ For a machine that should stay current with the repository, use the installed re
sudo -n sh /opt/importarr/repo-upgrade.sh
```
The helper refuses to run when the checkout has uncommitted changes, then performs `git pull --ff-only`, refreshes the editable install, restarts `importarr.service`, and prints service status. Use it after changes have been committed and pushed to `main`.
The helper refuses to run when the checkout has uncommitted changes, then performs `git pull --ff-only`, reinstalls the package from the repo, restarts `importarr.service`, and prints service status. Use it after changes have been committed and pushed to `main`.
Release-worthy changes should be committed, tagged with SemVer (`v0.1.1`, `v0.2.0`, ...), pushed with tags, then reinstalled from the tagged checkout or artifact. Do not hand-edit `/usr/local/sbin/importarr-status.py` or `/usr/local/sbin/manual-media-import.py` except for a documented emergency hotfix that is immediately backported here.
+1 -1
View File
@@ -30,6 +30,6 @@ fi
git fetch --prune origin
git pull --ff-only
"$VENV/bin/pip" install --upgrade --editable "$REPO_DIR"
"$VENV/bin/pip" install --upgrade "$REPO_DIR"
systemctl restart "$SERVICE"
systemctl --no-pager --full status "$SERVICE"
+1 -1
View File
@@ -15,7 +15,7 @@ fi
chown importarr:importarr /var/lib/importarr
python3 -m venv /opt/importarr/venv
/opt/importarr/venv/bin/pip install --upgrade pip
/opt/importarr/venv/bin/pip install --upgrade --editable "$REPO_DIR"
/opt/importarr/venv/bin/pip install --upgrade "$REPO_DIR"
if [ ! -f /etc/importarr/importarr.env ]; then
install -m 0600 "$REPO_DIR/deploy/importarr.env.example" /etc/importarr/importarr.env
echo "Created /etc/importarr/importarr.env; edit it before starting the service."