make sure we cleanup tmp. logging when we hit edge cases

This commit is contained in:
Michael Hobbs
2015-04-21 21:36:03 -07:00
parent e74c6460fb
commit 9d504fe93a

View File

@@ -28,7 +28,7 @@ generate_scale_file() {
copy_from_image "$IMAGE" "/app/DOKKU_SCALE" "$DOKKU_ROOT/$APP" 2>/dev/null || dokku_log_info1_quiet "DOKKU_SCALE not found in app image"
if [[ ! -f $DOKKU_SCALE_FILE ]]; then
local TMP_WORK_DIR=$(mktemp --tmpdir=/tmp -d DOKKU_SCALE.XXXXX)
trap 'rm -rf $TMP_WORK_DIR' EXIT
trap 'rm -rf $TMP_WORK_DIR' INT TERM EXIT RETURN
if is_image_buildstep_based "$IMAGE"; then
@@ -40,9 +40,11 @@ generate_scale_file() {
elif [[ -f $TMP_WORK_DIR/.release ]];then
local PROCFILE="$TMP_WORK_DIR/.release"
else
dokku_log_info1 "No Procfile or .release file found. Defaulting to a single web process"
echo "web=1" >> $DOKKU_SCALE_FILE
fi
else
dokku_log_info1 "Dockerfile build detected. Defaulting to a single web process"
echo "web=1" >> $DOKKU_SCALE_FILE
fi