refactor: use ps-current-scale instead of parsing DOKKU_SCALE file when iterating over deployed processes

This commit is contained in:
Jose Diaz-Gonzalez
2021-08-01 01:43:35 -04:00
parent c62bff3002
commit 213f7d224c
9 changed files with 67 additions and 29 deletions

View File

@@ -16,7 +16,7 @@ trigger-scheduler-docker-local-core-post-deploy() {
fi
dokku_log_info1 "Renaming containers"
local PROCTYPES="$(grep -v -E "^#" "$DOKKU_ROOT/$APP/DOKKU_SCALE" | awk -F '=' '{ print $1 }' | xargs)"
local PROCTYPES="$(plugn trigger ps-current-scale "$APP" | awk -F '=' '{ print $1 }' | xargs)"
local CONTAINER_FILES="$(find "$DOKKU_ROOT/$APP" -maxdepth 1 -name "CONTAINER.*" -printf "%f\n" 2>/dev/null | sort -t . -k 3 -n | xargs)"
local CONTAINER_FILE

View File

@@ -29,7 +29,6 @@ trigger-scheduler-docker-local-scheduler-deploy() {
local IMAGE_SOURCE_TYPE="dockerfile"
[[ "$DOKKU_HEROKUISH" == "true" ]] && IMAGE_SOURCE_TYPE="herokuish"
[[ "$DOKKU_CNB" == "true" ]] && IMAGE_SOURCE_TYPE="pack"
local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
local oldids=$(get_app_container_ids "$APP")
DOKKU_NETWORK_BIND_ALL="$(plugn trigger network-get-property "$APP" bind-all-interfaces)"
@@ -178,7 +177,7 @@ trigger-scheduler-docker-local-scheduler-deploy() {
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
done <"$DOKKU_SCALE_FILE"
done <"$(plugn trigger ps-current-scale "$APP")"
dokku_log_info1 "Running post-deploy"
plugn trigger core-post-deploy "$APP" "$port" "$ipaddr" "$IMAGE_TAG"