fix: popd out of tmp directory after a git push-based deployment

Without this, we end up with PWD issues as the tmp directory is removed automatically after a build.

Closes #6771
This commit is contained in:
Jose Diaz-Gonzalez
2024-03-28 20:53:31 -04:00
parent f4b1ce259a
commit d2cf2e7b91
2 changed files with 3 additions and 2 deletions

View File

@@ -86,10 +86,11 @@ fn-scheduler-deploy-process() {
local CONTAINER_IDX_OFFSET=$((PROC_COUNT + 1))
fi
local container_state_filetype
pushd "$DOKKU_ROOT/$APP" >/dev/null
for container_state_filetype in CONTAINER IP PORT; do
cd "$DOKKU_ROOT/$APP"
find . -maxdepth 1 -name "$container_state_filetype.$PROC_TYPE.*" -printf "%f\n" | sort -t . -k 3 -n | tail -n +$CONTAINER_IDX_OFFSET | xargs rm -f
done
popd &>/dev/null || pushd "/tmp" >/dev/null
}
main() {