feat: inject the dokku PID into temporary files/directories

This will allow background processes to cleanup these files if they were unable to be cleaned up during a run of the dokku binary, as is the case for files copied by the docker binary when running in docker.
This commit is contained in:
Jose Diaz-Gonzalez committed 2019-08-12 17:56:17 -04:00
1 parent 0588b6f161
commit 925c6c4c28
15 files changed
+16 -15

No files matched your search

+1 -1
View File
@@ -80,7 +80,7 @@ scheduler-docker-local-check-deploy() {
# use this number of retries for checks
local ATTEMPTS="${DOKKU_CHECKS_ATTEMPTS:-5}"
local CHECK_DEPLOY_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${FUNCNAME[0]}.XXXX")
local CHECK_DEPLOY_TMP_WORK_DIR=$(mktemp -d "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXX")
local CHECKS_FILENAME=${CHECK_DEPLOY_TMP_WORK_DIR}/CHECKS
local IMAGE_TAG="$(get_running_image_tag "$APP")"
local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
@@ -13,7 +13,7 @@ scheduler-docker-local-scheduler-inspect() {
return
fi
local TMP_INSPECT_CMD=$(mktemp "/tmp/dokku-${FUNCNAME[0]}.XXXX")
local TMP_INSPECT_CMD=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXX")
trap "rm -rf '$TMP_INSPECT_CMD' >/dev/null" RETURN INT TERM EXIT
cat >"$TMP_INSPECT_CMD" <<EOF
import json