Skip to content

Commit

Permalink
switch to virtualenv
Browse files Browse the repository at this point in the history
  • Loading branch information
binhex committed Aug 23, 2022
1 parent 1066c50 commit e3dc629
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 5 additions & 3 deletions build/root/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ github.sh --install-path "${install_path_nzbnotify}" --github-owner 'caronc' --g
# python
####

virtualenv_path="${install_path_sabnzbd}/venv"

# use pip to install requirements for sabnzbd as defined in requirements.txt
pip.sh --install-path "${install_path_sabnzbd}" --create-virtualenv 'no' --log-level 'WARN'
pip.sh --install-path "${install_path_sabnzbd}" --create-virtualenv 'yes' --virtualenv-path "${virtualenv_path}" --log-level 'WARN'

# use pip to install requirements for nzbnotify as defined in requirements.txt
pip.sh --install-path "${install_path_nzbnotify}" --create-virtualenv 'no' --log-level 'WARN'
# use pip to install requirements for nzbnotify as defined in requirements.txt, create modules in sabnz\bd virtualenv path
pip.sh --install-path "${install_path_nzbnotify}" --create-virtualenv 'yes' --virtualenv-path "${virtualenv_path}" --log-level 'WARN'

# container perms
####
Expand Down
10 changes: 8 additions & 2 deletions run/nobody/sabnzbd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ if [[ "${sabnzbd_running}" == "false" ]]; then

echo "[info] Attempting to start SABnzbd..."

# run app (non blocking)
python3 /usr/lib/sabnzbd/SABnzbd.py --daemon --config-file /config --server 0.0.0.0:8080 --https 8090
install_path="/usr/lib/sabnzbd"
virtualenv_path="${install_path}/venv"

# activate virtualenv where requirements have been installed from install.sh
source "${virtualenv_path}/bin/activate"

# run app
python3 "${install_path}/SABnzbd.py" --config-file /config --server 0.0.0.0:8080 --https 8090

# make sure process sabnzbd DOES exist
retry_count=12
Expand Down

0 comments on commit e3dc629

Please sign in to comment.