deploy: improve rsync filter

This commit is contained in:
Jörg Thalheim 2022-02-04 09:27:45 +01:00
parent 053daefbf4
commit 6d32ac1baa

View file

@ -8,6 +8,8 @@ from deploy_nixos import DeployHost, DeployGroup
import subprocess
import json
RSYNC_EXCLUDES = [".terraform", ".direnv", ".mypy-cache", ".git"]
def deploy_nixos(hosts: List[DeployHost]) -> None:
"""
@ -17,7 +19,7 @@ def deploy_nixos(hosts: List[DeployHost]) -> None:
def deploy(h: DeployHost) -> None:
h.run_local(
f"rsync --exclude='.git/' -vaF --delete -e ssh . {h.user}@{h.host}:/etc/nixos",
f"rsync {' --exclude '.join([''] + RSYNC_EXCLUDES)} -vaF --delete -e ssh . {h.user}@{h.host}:/etc/nixos"
)
config = (