diff --git a/plugins/ps/functions b/plugins/ps/functions index 48f9ed7cb..d550b8bdd 100755 --- a/plugins/ps/functions +++ b/plugins/ps/functions @@ -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" diff --git a/tests/unit/10_ps-dockerfile.bats b/tests/unit/10_ps-dockerfile.bats index 513c32141..cd7329c6f 100644 --- a/tests/unit/10_ps-dockerfile.bats +++ b/tests/unit/10_ps-dockerfile.bats @@ -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