Skip to content

Commit cf875f1

Browse files
committed
ci: delete old files when backing up acmetool state and DKIM keys
1 parent 132bdcb commit cf875f1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

.github/workflows/test-and-deploy-ipv4only.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ jobs:
3232
chmod 600 ~/.ssh/id_ed25519
3333
ssh-keyscan staging-ipv4.testrun.org > ~/.ssh/known_hosts
3434
# save previous acme & dkim state
35-
rsync -avz [email protected]:/var/lib/acme acme-ipv4 || true
36-
rsync -avz [email protected]:/etc/dkimkeys dkimkeys-ipv4 || true
35+
rsync -avz --delete [email protected]:/var/lib/acme acme-ipv4
36+
rsync -avz --delete [email protected]:/etc/dkimkeys dkimkeys-ipv4
3737
# store previous acme & dkim state on ns.testrun.org, if it contains useful certs
38-
if [ -f dkimkeys-ipv4/dkimkeys/opendkim.private ]; then rsync -avz -e "ssh -o StrictHostKeyChecking=accept-new" dkimkeys-ipv4 [email protected]:/tmp/ || true; fi
39-
if [ "$(ls -A acme-ipv4/acme/certs)" ]; then rsync -avz -e "ssh -o StrictHostKeyChecking=accept-new" acme-ipv4 [email protected]:/tmp/ || true; fi
38+
test -f dkimkeys-ipv4/dkimkeys/opendkim.private && rsync -avz --delete -e "ssh -o StrictHostKeyChecking=accept-new" dkimkeys-ipv4 [email protected]:/tmp/
39+
test -n "$(ls -A acme-ipv4/acme/certs)" && rsync -avz --delete -e "ssh -o StrictHostKeyChecking=accept-new" acme-ipv4 [email protected]:/tmp/
4040
# make sure CAA record isn't set
4141
scp -o StrictHostKeyChecking=accept-new .github/workflows/staging-ipv4.testrun.org-default.zone [email protected]:/etc/nsd/staging-ipv4.testrun.org.zone
4242
ssh [email protected] sed -i '/CAA/d' /etc/nsd/staging-ipv4.testrun.org.zone

.github/workflows/test-and-deploy.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ jobs:
3232
chmod 600 ~/.ssh/id_ed25519
3333
ssh-keyscan staging2.testrun.org > ~/.ssh/known_hosts
3434
# save previous acme & dkim state
35-
rsync -avz [email protected]:/var/lib/acme . || true
36-
rsync -avz [email protected]:/etc/dkimkeys . || true
35+
rsync -avz --delete [email protected]:/var/lib/acme .
36+
rsync -avz --delete [email protected]:/etc/dkimkeys .
3737
# store previous acme & dkim state on ns.testrun.org, if it contains useful certs
38-
if [ -f dkimkeys/opendkim.private ]; then rsync -avz -e "ssh -o StrictHostKeyChecking=accept-new" dkimkeys [email protected]:/tmp/ || true; fi
39-
if [ "$(ls -A acme/certs)" ]; then rsync -avz -e "ssh -o StrictHostKeyChecking=accept-new" acme [email protected]:/tmp/ || true; fi
38+
test -f dkimkeys/opendkim.private && rsync -avz --delete -e "ssh -o StrictHostKeyChecking=accept-new" dkimkeys [email protected]:/tmp/
39+
test -n "$(ls -A acme/certs)" && rsync -avz -e "ssh -o StrictHostKeyChecking=accept-new" acme [email protected]:/tmp/
4040
# make sure CAA record isn't set
4141
scp -o StrictHostKeyChecking=accept-new .github/workflows/staging.testrun.org-default.zone [email protected]:/etc/nsd/staging2.testrun.org.zone
4242
ssh [email protected] sed -i '/CAA/d' /etc/nsd/staging2.testrun.org.zone

0 commit comments

Comments
 (0)