refactor: move CHECKS file extraction to the beginning of the deploy

This makes deploys faster for any that are built from source as the image artifact isn't involved in those cases while also unifying how the file is handled.

Refs #2760
This commit is contained in:
Jose Diaz-Gonzalez
2023-07-02 15:34:24 -04:00
parent 94f4d1325c
commit fb9d77878d
7 changed files with 130 additions and 26 deletions

View File

@@ -67,6 +67,44 @@ cmd-scheduler-docker-local-report-single() {
fi
}
fn-scheduler-docker-local-get-checks-file-path() {
declare APP="$1"
echo "${DOKKU_LIB_ROOT}/data/scheduler-docker-local/$APP/CHECKS"
}
fn-scheduler-docker-local-get-process-specific-checks-file-path() {
declare APP="$1"
checks_path="$(fn-scheduler-docker-local-get-checks-file-path "$APP")"
process_specific_checks_path="$checks_path.$DOKKU_PID"
if [[ -f "$process_specific_checks_path" ]]; then
echo "$process_specific_checks_path"
return
fi
echo "$checks_path"
}
fn-scheduler-docker-local-has-checks-file() {
declare APP="$1"
checks_path="$(fn-scheduler-docker-local-get-checks-file-path "$APP")"
if [[ -f "$checks_path.$DOKKU_PID.missing" ]]; then
return 1
fi
if [[ -f "$checks_path.$DOKKU_PID" ]]; then
return 0
fi
if [[ -f "$checks_path" ]]; then
return 0
fi
return 1
}
fn-scheduler-docker-local-retire-container() {
declare APP="$1" CID="$2"
local STATE