pyinfra: added virtual environment

pull/7/head
missytake 2023-10-08 11:44:18 +02:00
parent beddedf85d
commit c253493834
3 changed files with 14 additions and 1 deletions

View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
python3 -m venv ~/.local/lib/teams-bot.venv
source ~/.local/lib/teams-bot.venv/bin/activate
pip install -U pip wheel

View File

@ -0,0 +1,7 @@
export XDG_RUNTIME_DIR="/run/user/$UID"
export DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm if it exists
[ -s "$HOME/.cargo/env" ] && . "$HOME/.cargo/env" # This loads the cargo environment if it exists
export PATH=$PATH:$HOME/.local/bin

View File

@ -2,7 +2,7 @@
Description=run deltachat teams-bot: {{ bot_email }}
[Service]
ExecStart=/home/{{ unix_user }}/.venv/bin/teams-bot run -v
ExecStart=/home/{{ unix_user }}/.local/lib/teams-bot.venv/bin/teams-bot run -v
EnvironmentFile=/home/{{ unix_user }}/.env
Restart=on-failure
RestartSec=5s