hack: pull procfile if possible when setting ps:scale

This commit is contained in:
Jose Diaz-Gonzalez
2018-08-25 11:54:36 -04:00
parent 2ec99bc853
commit 64c6437e4e
2 changed files with 5 additions and 2 deletions

View File

@@ -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"

View File

@@ -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