diff --git a/chatmail-pyinfra/pyproject.toml b/deploy-chatmail/pyproject.toml similarity index 94% rename from chatmail-pyinfra/pyproject.toml rename to deploy-chatmail/pyproject.toml index 55cc6382..3d98b8a4 100644 --- a/chatmail-pyinfra/pyproject.toml +++ b/deploy-chatmail/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=45"] build-backend = "setuptools.build_meta" [project] -name = "chatmail" +name = "deploy-chatmail" version = "0.1" dependencies = [ "pyinfra", diff --git a/chatmail-pyinfra/src/chatmail/__init__.py b/deploy-chatmail/src/deploy_chatmail/__init__.py similarity index 100% rename from chatmail-pyinfra/src/chatmail/__init__.py rename to deploy-chatmail/src/deploy_chatmail/__init__.py diff --git a/chatmail-pyinfra/src/chatmail/acmetool/__init__.py b/deploy-chatmail/src/deploy_chatmail/acmetool/__init__.py similarity index 100% rename from chatmail-pyinfra/src/chatmail/acmetool/__init__.py rename to deploy-chatmail/src/deploy_chatmail/acmetool/__init__.py diff --git a/chatmail-pyinfra/src/chatmail/acmetool/acmetool-redirector.service b/deploy-chatmail/src/deploy_chatmail/acmetool/acmetool-redirector.service similarity index 100% rename from chatmail-pyinfra/src/chatmail/acmetool/acmetool-redirector.service rename to deploy-chatmail/src/deploy_chatmail/acmetool/acmetool-redirector.service diff --git a/chatmail-pyinfra/src/chatmail/acmetool/acmetool.cron b/deploy-chatmail/src/deploy_chatmail/acmetool/acmetool.cron similarity index 100% rename from chatmail-pyinfra/src/chatmail/acmetool/acmetool.cron rename to deploy-chatmail/src/deploy_chatmail/acmetool/acmetool.cron diff --git a/chatmail-pyinfra/src/chatmail/acmetool/acmetool.hook b/deploy-chatmail/src/deploy_chatmail/acmetool/acmetool.hook similarity index 100% rename from chatmail-pyinfra/src/chatmail/acmetool/acmetool.hook rename to deploy-chatmail/src/deploy_chatmail/acmetool/acmetool.hook diff --git a/chatmail-pyinfra/src/chatmail/acmetool/response-file.yaml.j2 b/deploy-chatmail/src/deploy_chatmail/acmetool/response-file.yaml.j2 similarity index 100% rename from chatmail-pyinfra/src/chatmail/acmetool/response-file.yaml.j2 rename to deploy-chatmail/src/deploy_chatmail/acmetool/response-file.yaml.j2 diff --git a/chatmail-pyinfra/src/chatmail/dovecot/auth.conf b/deploy-chatmail/src/deploy_chatmail/dovecot/auth.conf similarity index 100% rename from chatmail-pyinfra/src/chatmail/dovecot/auth.conf rename to deploy-chatmail/src/deploy_chatmail/dovecot/auth.conf diff --git a/chatmail-pyinfra/src/chatmail/dovecot/dovecot.conf.j2 b/deploy-chatmail/src/deploy_chatmail/dovecot/dovecot.conf.j2 similarity index 100% rename from chatmail-pyinfra/src/chatmail/dovecot/dovecot.conf.j2 rename to deploy-chatmail/src/deploy_chatmail/dovecot/dovecot.conf.j2 diff --git a/chatmail-pyinfra/src/chatmail/opendkim/opendkim.conf b/deploy-chatmail/src/deploy_chatmail/opendkim/opendkim.conf similarity index 100% rename from chatmail-pyinfra/src/chatmail/opendkim/opendkim.conf rename to deploy-chatmail/src/deploy_chatmail/opendkim/opendkim.conf diff --git a/chatmail-pyinfra/src/chatmail/postfix/main.cf.j2 b/deploy-chatmail/src/deploy_chatmail/postfix/main.cf.j2 similarity index 100% rename from chatmail-pyinfra/src/chatmail/postfix/main.cf.j2 rename to deploy-chatmail/src/deploy_chatmail/postfix/main.cf.j2 diff --git a/chatmail-pyinfra/src/chatmail/postfix/master.cf b/deploy-chatmail/src/deploy_chatmail/postfix/master.cf similarity index 100% rename from chatmail-pyinfra/src/chatmail/postfix/master.cf rename to deploy-chatmail/src/deploy_chatmail/postfix/master.cf diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 265804ab..695135cc 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -2,9 +2,9 @@ : ${CHATMAIL_DOMAIN:=c1.testrun.org} export CHATMAIL_DOMAIN -venv/bin/python3 -m build --sdist doveauth --outdir dist -venv/bin/python3 -m build --sdist filtermail --outdir dist +venv/bin/python3 -m build -n --sdist doveauth --outdir dist +venv/bin/python3 -m build -n --sdist filtermail --outdir dist -chatmail-pyinfra/venv/bin/pyinfra --ssh-user root "$CHATMAIL_DOMAIN" deploy.py +deploy-chatmail/venv/bin/pyinfra --ssh-user root "$CHATMAIL_DOMAIN" deploy.py rm -r dist/ diff --git a/scripts/init.sh b/scripts/init.sh index 149aa052..fe2c1fde 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -1,8 +1,8 @@ #!/bin/sh -python3 -m venv chatmail-pyinfra/venv -chatmail-pyinfra/venv/bin/pip install pyinfra pytest -chatmail-pyinfra/venv/bin/pip install -e chatmail-pyinfra -chatmail-pyinfra/venv/bin/pip install -e doveauth +python3 -m venv deploy-chatmail/venv +deploy-chatmail/venv/bin/pip install pyinfra pytest +deploy-chatmail/venv/bin/pip install -e deploy-chatmail +deploy-chatmail/venv/bin/pip install -e doveauth python3 -m venv doveauth/venv doveauth/venv/bin/pip install pytest diff --git a/scripts/remote-deploy.sh b/scripts/remote-deploy.sh index b3f1c3a4..55d44378 100755 --- a/scripts/remote-deploy.sh +++ b/scripts/remote-deploy.sh @@ -5,4 +5,4 @@ set -e : ${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; apt install -y python3-venv; 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" +ssh "root@$CHATMAIL_SSH_HOST" "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 doveauth --outdir dist; venv/bin/python3 -m build -n --sdist filtermail --outdir dist; venv/bin/pip install -e ./deploy-chatmail -e ./doveauth; export CHATMAIL_DOMAIN=$CHATMAIL_DOMAIN; venv/bin/pyinfra @local deploy.py"