mirror of
https://github.com/dokku/dokku.git
synced 2026-02-24 04:00:36 +01:00
hack: pull procfile if possible when setting ps:scale
This commit is contained in:
@@ -92,11 +92,14 @@ set_scale() {
|
||||
local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE"
|
||||
shift 1
|
||||
|
||||
extract_procfile "$APP" "$IMAGE_TAG" > /dev/null
|
||||
trap 'remove_procfile $APP' RETURN INT TERM EXIT
|
||||
|
||||
local SCALE_SETTINGS=("$@")
|
||||
for procscale in "${SCALE_SETTINGS[@]}"; do
|
||||
local PROC_NAME=${procscale%%=*}
|
||||
local PROC_COUNT=${procscale#*=}
|
||||
if [[ -f "$DOKKU_PROCFILE" ]] && ! procfile-util exists --procfile "$DOKKU_PROCFILE" --process-type "$PROC_NAME" > /dev/null 2>&1; then
|
||||
if [[ -f "$DOKKU_PROCFILE" ]] && ! procfile-util exists --procfile "$DOKKU_SCALE_FILE" --process-type "$PROC_NAME" > /dev/null 2>&1; then
|
||||
dokku_log_fail "${PROC_NAME} is not a valid process name"
|
||||
fi
|
||||
is_number "$PROC_COUNT" || dokku_log_fail "ps:scale $PROC_COUNT is not a number"
|
||||
|
||||
@@ -71,7 +71,7 @@ teardown() {
|
||||
}
|
||||
|
||||
@test "(ps:scale) dockerfile non-existent process" {
|
||||
run bash -c "dokku ps:scale $TEST_APP non-existent=2"
|
||||
run bash -c "dokku --trace ps:scale $TEST_APP non-existent=2"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_failure
|
||||
|
||||
Reference in New Issue
Block a user