From f85e4cdbd506519febd1fe64d6c7ec8383e44580 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sun, 15 Oct 2023 00:21:48 +0000 Subject: [PATCH] Add scripts/remote-deploy.sh It is faster than deploying over SSH, 23 seconds vs 40 seconds here. --- scripts/remote-deploy.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 scripts/remote-deploy.sh diff --git a/scripts/remote-deploy.sh b/scripts/remote-deploy.sh new file mode 100755 index 00000000..d5c2ceda --- /dev/null +++ b/scripts/remote-deploy.sh @@ -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"