chatmail/scripts/remote-deploy.sh

9 lines
521 B
Bash
Raw Normal View History

#!/bin/sh
set -e
: ${CHATMAIL_DOMAIN:=c1.testrun.org}
2023-10-17 00:33:07 +02:00
: ${CHATMAIL_SSH:=$CHATMAIL_DOMAIN}
2023-10-17 00:33:07 +02:00
rsync -avz . "root@$CHATMAIL_SSH:/root/chatmail" --exclude='/.git' --filter="dir-merge,- .gitignore"
ssh "root@$CHATMAIL_SSH" "cd /root/chatmail; apt install -y python3-venv; python3 -m venv venv; venv/bin/pip install pyinfra build; venv/bin/python3 -m build -n --sdist chatmaild --outdir dist; venv/bin/pip install -e ./deploy-chatmail -e ./chatmaild; export CHATMAIL_DOMAIN=$CHATMAIL_DOMAIN; venv/bin/pyinfra @local deploy.py"