Add scripts/remote-deploy.sh

It is faster than deploying over SSH,
23 seconds vs 40 seconds here.
This commit is contained in:
link2xt
2023-10-15 00:21:48 +00:00
parent 1d7ebfa7a5
commit f85e4cdbd5

8
scripts/remote-deploy.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
set -e
: ${CHATMAIL_DOMAIN:=c1.testrun.org}
: ${CHATMAIL_SSH_HOST:=$CHATMAIL_DOMAIN}
rsync -avz . "root@$CHATMAIL_SSH_HOST:/root/chatmail" --exclude='/.git' --filter="dir-merge,- .gitignore"
ssh "root@$CHATMAIL_SSH_HOST" "cd /root/chatmail; python3 -m venv venv; venv/bin/pip install pyinfra build; venv/bin/python3 -m build -n --sdist doveauth --outdir dist; venv/bin/python3 -m build -n --sdist filtermail --outdir dist; venv/bin/pip install -e ./chatmail-pyinfra -e ./doveauth; export CHATMAIL_DOMAIN=$CHATMAIL_DOMAIN; venv/bin/pyinfra @local deploy.py"