fix: clean up stale extracted files on deploy

A failed deploy could leave a non-empty extraction directory behind, such as the scheduler-k3s `kustomization` directory, which caused every following deploy to fail. Leftovers from previous deploys are now fully removed, removing a directory such as `config/kustomize` from the repository now removes the stored copy, and openresty includes now persist across restarts.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-10-23 14:37:49 -04:00
1 parent a73e6b67bc
commit 0690a9b655
12 files changed
+315 -41

No files matched your search

+19
View File
@@ -129,3 +129,22 @@ teardown() {
docker image rm dokku-test/$TEST_APP:latest dokku-test/$TEST_APP:v2 || true
}
@test "(nginx-vhosts) deploy removes stale nginx.conf.sigil files" {
local DATA_DIR="/var/lib/dokku/data/nginx-vhosts/app-$TEST_APP"
mkdir -p "$DATA_DIR"
echo "# stale" >"$DATA_DIR/nginx.conf.sigil.99999999"
touch "$DATA_DIR/nginx.conf.sigil.99999998.missing"
chown -R dokku:dokku "$DATA_DIR"
run deploy_app python dokku@$DOKKU_DOMAIN:$TEST_APP
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "find $DATA_DIR -maxdepth 1 -name 'nginx.conf.sigil.*'"
echo "output: $output"
echo "status: $status"
assert_success
assert_output_not_exists
}