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"
|
local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE"
|
||||||
shift 1
|
shift 1
|
||||||
|
|
||||||
|
extract_procfile "$APP" "$IMAGE_TAG" > /dev/null
|
||||||
|
trap 'remove_procfile $APP' RETURN INT TERM EXIT
|
||||||
|
|
||||||
local SCALE_SETTINGS=("$@")
|
local SCALE_SETTINGS=("$@")
|
||||||
for procscale in "${SCALE_SETTINGS[@]}"; do
|
for procscale in "${SCALE_SETTINGS[@]}"; do
|
||||||
local PROC_NAME=${procscale%%=*}
|
local PROC_NAME=${procscale%%=*}
|
||||||
local PROC_COUNT=${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"
|
dokku_log_fail "${PROC_NAME} is not a valid process name"
|
||||||
fi
|
fi
|
||||||
is_number "$PROC_COUNT" || dokku_log_fail "ps:scale $PROC_COUNT is not a number"
|
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" {
|
@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 "output: "$output
|
||||||
echo "status: "$status
|
echo "status: "$status
|
||||||
assert_failure
|
assert_failure
|
||||||
|
|||||||
Reference in New Issue
Block a user