Install Importarr from packaged repo build
This commit is contained in:
@@ -3,7 +3,7 @@ PIP ?= .venv/bin/pip
|
|||||||
SERVICE ?= importarr.service
|
SERVICE ?= importarr.service
|
||||||
LIVE_URL ?= http://127.0.0.1:8095
|
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:
|
test:
|
||||||
$(PYTHON) -m pytest
|
$(PYTHON) -m pytest
|
||||||
@@ -11,11 +11,11 @@ test:
|
|||||||
install-systemd:
|
install-systemd:
|
||||||
sudo -n sh deploy/systemd-install.sh
|
sudo -n sh deploy/systemd-install.sh
|
||||||
|
|
||||||
install-editable:
|
install-from-repo:
|
||||||
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
|
||||||
|
|
||||||
upgrade-local:
|
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)
|
sudo -n systemctl restart $(SERVICE)
|
||||||
|
|
||||||
repo-upgrade:
|
repo-upgrade:
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ sudo ${EDITOR:-vi} /etc/importarr/importarr.env
|
|||||||
sudo systemctl start importarr.service
|
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:
|
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
|
cd /srv/opencode-workspace/importarr
|
||||||
.venv/bin/python -m pytest
|
.venv/bin/python -m pytest
|
||||||
git status --short --branch
|
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
|
sudo -n systemctl restart importarr.service
|
||||||
make verify-live
|
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
|
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.
|
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.
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,6 @@ fi
|
|||||||
|
|
||||||
git fetch --prune origin
|
git fetch --prune origin
|
||||||
git pull --ff-only
|
git pull --ff-only
|
||||||
"$VENV/bin/pip" install --upgrade --editable "$REPO_DIR"
|
"$VENV/bin/pip" install --upgrade "$REPO_DIR"
|
||||||
systemctl restart "$SERVICE"
|
systemctl restart "$SERVICE"
|
||||||
systemctl --no-pager --full status "$SERVICE"
|
systemctl --no-pager --full status "$SERVICE"
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ fi
|
|||||||
chown importarr:importarr /var/lib/importarr
|
chown importarr:importarr /var/lib/importarr
|
||||||
python3 -m venv /opt/importarr/venv
|
python3 -m venv /opt/importarr/venv
|
||||||
/opt/importarr/venv/bin/pip install --upgrade pip
|
/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
|
if [ ! -f /etc/importarr/importarr.env ]; then
|
||||||
install -m 0600 "$REPO_DIR/deploy/importarr.env.example" /etc/importarr/importarr.env
|
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."
|
echo "Created /etc/importarr/importarr.env; edit it before starting the service."
|
||||||
|
|||||||
Reference in New Issue
Block a user