From d156cff7e4aa09f797c740fd5ac8d70a47848a74 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 12:33:48 -0400 Subject: [PATCH 01/24] chore: sort rpm dependencies --- rpm.mk | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rpm.mk b/rpm.mk index 9fe76e747..1ac65180b 100644 --- a/rpm.mk +++ b/rpm.mk @@ -95,20 +95,20 @@ endif -v "$$VERSION" \ -a $(RPM_ARCHITECTURE) \ -p "dokku-$$VERSION-1.x86_64.rpm" \ - --depends 'git' \ - --depends 'make' \ - --depends 'curl' \ - --depends 'gcc' \ - --depends 'man-db' \ - --depends 'sshcommand' \ - --depends 'gliderlabs-sigil' \ --depends '/usr/bin/docker' \ --depends 'bind-utils' \ + --depends 'curl' \ + --depends 'gcc' \ + --depends 'git' \ + --depends 'gliderlabs-sigil' \ + --depends 'make' \ + --depends 'man-db' \ + --depends 'nc' \ --depends 'nginx >= 1.8.0' \ --depends 'plugn' \ - --depends 'sudo' \ --depends 'python' \ - --depends 'nc' \ + --depends 'sshcommand' \ + --depends 'sudo' \ --after-install rpm/dokku.postinst \ --url "https://github.com/$(DOKKU_REPO_NAME)" \ --description $(DOKKU_DESCRIPTION) \ From aeeb2e138fbd6e44b64736528ac14ed017c6e23d Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 12:38:30 -0400 Subject: [PATCH 02/24] feat: install procfile-util --- Makefile | 13 +++++++++---- debian/control | 2 +- rpm.mk | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 55cbed0cd..df092c880 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ DOKKU_VERSION ?= master SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/v0.7.0/sshcommand +PROCFILE_UTIL_URL ?= https://github.com/josegonzalez/go-procfile-util/releases/download/v0.2.0/procfile-util_0.2.0_linux_x86_64.tgz PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v0.3.0/plugn_0.3.0_linux_x86_64.tgz SIGIL_URL ?= https://github.com/gliderlabs/sigil/releases/download/v0.4.0/sigil_0.4.0_Linux_x86_64.tgz STACK_URL ?= https://github.com/gliderlabs/herokuish.git @@ -26,7 +27,7 @@ endif include common.mk -.PHONY: all apt-update install version copyfiles copyplugin man-db plugins dependencies sshcommand plugn docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku go-build +.PHONY: all apt-update install version copyfiles copyplugin man-db plugins dependencies sshcommand procfile-util plugn docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku go-build include tests.mk include deb.mk @@ -109,13 +110,13 @@ else echo $(DOKKU_VERSION) > ~dokku/VERSION endif -plugin-dependencies: plugn +plugin-dependencies: plugn procfile-util sudo -E dokku plugin:install-dependencies --core -plugins: plugn docker +plugins: plugn procfile-util docker sudo -E dokku plugin:install --core -dependencies: apt-update sshcommand plugn docker help2man man-db sigil +dependencies: apt-update sshcommand plugn procfile-util docker help2man man-db sigil $(MAKE) -e stack apt-update: @@ -132,6 +133,10 @@ sshcommand: chmod +x /usr/local/bin/sshcommand sshcommand create dokku /usr/local/bin/dokku +procfile-util: + wget -qO /tmp/procfile-util_latest.tgz ${PROCFILE_UTIL_URL} + tar xzf /tmp/procfile-util_latest.tgz -C /usr/local/bin + plugn: wget -qO /tmp/plugn_latest.tgz ${PLUGN_URL} tar xzf /tmp/plugn_latest.tgz -C /usr/local/bin diff --git a/debian/control b/debian/control index 0459eaa80..e2e60dbdd 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Version: 0.12.13 Section: web Priority: optional Architecture: amd64 -Depends: locales, git, make, curl, gcc, man-db, netcat, sshcommand (>= 0.6.0), gliderlabs-sigil, docker-engine-cs (>= 1.7.1) | docker-engine (>= 1.7.1) | docker-io (>= 1.7.1) | docker-ce | docker-ee, net-tools, software-properties-common, python-software-properties | python3-software-properties, rsyslog +Depends: locales, git, make, curl, gcc, man-db, netcat, sshcommand (>= 0.6.0), gliderlabs-sigil, docker-engine-cs (>= 1.7.1) | docker-engine (>= 1.7.1) | docker-io (>= 1.7.1) | docker-ce | docker-ee, net-tools, software-properties-common, procfile-util, python-software-properties | python3-software-properties, rsyslog Recommends: herokuish (>= 0.3.4), parallel, dokku-update Pre-Depends: nginx (>= 1.8.0) | openresty, dnsutils, cgroupfs-mount | cgroup-lite, plugn (>= 0.3.0), sudo, python2.7, debconf Maintainer: Jose Diaz-Gonzalez diff --git a/rpm.mk b/rpm.mk index 1ac65180b..61340546d 100644 --- a/rpm.mk +++ b/rpm.mk @@ -106,6 +106,7 @@ endif --depends 'nc' \ --depends 'nginx >= 1.8.0' \ --depends 'plugn' \ + --depends 'procfile-util' \ --depends 'python' \ --depends 'sshcommand' \ --depends 'sudo' \ From 2db8f93507f5ee99b2c2175a6f75a58bf2719b30 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 13:01:28 -0400 Subject: [PATCH 03/24] feat: error out on Procfile extraction if the procfile is invalid Refs #2991 Refs #3196 --- plugins/ps/functions | 3 +++ tests/apps/dockerfile-procfile-bad/CHECKS | 5 +++++ tests/apps/dockerfile-procfile-bad/Dockerfile | 11 +++++++++++ tests/apps/dockerfile-procfile-bad/Procfile | 12 ++++++++++++ tests/apps/dockerfile-procfile-bad/check_deploy | 2 ++ tests/apps/dockerfile-procfile-bad/package.json | 13 +++++++++++++ tests/apps/dockerfile-procfile-bad/web.js | 12 ++++++++++++ tests/apps/dockerfile-procfile-bad/worker.js | 6 ++++++ tests/unit/10_git.bats | 2 +- tests/unit/10_ps-dockerfile.bats | 8 +++++++- 10 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 tests/apps/dockerfile-procfile-bad/CHECKS create mode 100644 tests/apps/dockerfile-procfile-bad/Dockerfile create mode 100644 tests/apps/dockerfile-procfile-bad/Procfile create mode 100644 tests/apps/dockerfile-procfile-bad/check_deploy create mode 100644 tests/apps/dockerfile-procfile-bad/package.json create mode 100644 tests/apps/dockerfile-procfile-bad/web.js create mode 100644 tests/apps/dockerfile-procfile-bad/worker.js diff --git a/plugins/ps/functions b/plugins/ps/functions index cbb1793c6..beffac916 100755 --- a/plugins/ps/functions +++ b/plugins/ps/functions @@ -23,6 +23,9 @@ extract_procfile() { copy_from_image "$IMAGE" "Procfile" "$DOKKU_PROCFILE" 2>/dev/null || true if [[ -f "$DOKKU_PROCFILE" ]]; then dokku_log_info1_quiet "App Procfile file found ($DOKKU_PROCFILE)" + # shellcheck disable=SC2069 + PROCFILE_ERRORS="$(procfile-util check "$DOKKU_PROCFILE" 2>&1 >/dev/null || true)" + [[ -n "$PROCFILE_ERRORS" ]] && dokku_log_fail "${PROCFILE_ERRORS}" else dokku_log_info1_quiet "No Procfile found in app image" fi diff --git a/tests/apps/dockerfile-procfile-bad/CHECKS b/tests/apps/dockerfile-procfile-bad/CHECKS new file mode 100644 index 000000000..068926825 --- /dev/null +++ b/tests/apps/dockerfile-procfile-bad/CHECKS @@ -0,0 +1,5 @@ +WAIT=2 # wait 2 seconds +TIMEOUT=5 # set timeout to 5 seconds +ATTEMPTS=2 # try 2 times + +/ nodejs/express diff --git a/tests/apps/dockerfile-procfile-bad/Dockerfile b/tests/apps/dockerfile-procfile-bad/Dockerfile new file mode 100644 index 000000000..fa82185d5 --- /dev/null +++ b/tests/apps/dockerfile-procfile-bad/Dockerfile @@ -0,0 +1,11 @@ +FROM node:4 + +EXPOSE 3001/udp +EXPOSE 3000/tcp +EXPOSE 3003 + +COPY . /app +WORKDIR /app +RUN npm install + +CMD npm start diff --git a/tests/apps/dockerfile-procfile-bad/Procfile b/tests/apps/dockerfile-procfile-bad/Procfile new file mode 100644 index 000000000..ad7dc37c9 --- /dev/null +++ b/tests/apps/dockerfile-procfile-bad/Procfile @@ -0,0 +1,12 @@ +############################### +# DEVELOPMENT # +############################### + +# Procfile for development using the new threaded worker (scheduler, twitter stream and delayed job) +cron: node worker.js +web: node web.js +<<<<<<< HEAD=0 +worker: node worker.js +========0 +worker: node worker-2.js +>>>>>>> 5bb7ec3e2a8f4f6565432a4fc82c92d4a3603d28=0 diff --git a/tests/apps/dockerfile-procfile-bad/check_deploy b/tests/apps/dockerfile-procfile-bad/check_deploy new file mode 100644 index 000000000..1334888e2 --- /dev/null +++ b/tests/apps/dockerfile-procfile-bad/check_deploy @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +set -e; output="$(curl -s -S "$1")"; echo "$output"; test "$output" == "nodejs/express" diff --git a/tests/apps/dockerfile-procfile-bad/package.json b/tests/apps/dockerfile-procfile-bad/package.json new file mode 100644 index 000000000..397b0ce84 --- /dev/null +++ b/tests/apps/dockerfile-procfile-bad/package.json @@ -0,0 +1,13 @@ +{ + "name": "node-example", + "version": "0.0.1", + "dependencies": { + "express": "2.5.x" + }, + "engines": { + "node": "4.2.x" + }, + "scripts": { + "start": "false" + } +} diff --git a/tests/apps/dockerfile-procfile-bad/web.js b/tests/apps/dockerfile-procfile-bad/web.js new file mode 100644 index 000000000..6b8f4d819 --- /dev/null +++ b/tests/apps/dockerfile-procfile-bad/web.js @@ -0,0 +1,12 @@ +var express = require('express'); + +var app = express.createServer(express.logger()); + +app.get('/', function(request, response) { + response.send('nodejs/express'); +}); + +var port = process.env.PORT || 5000; +app.listen(port, function() { + console.log("Listening on " + port); +}); diff --git a/tests/apps/dockerfile-procfile-bad/worker.js b/tests/apps/dockerfile-procfile-bad/worker.js new file mode 100644 index 000000000..12133530d --- /dev/null +++ b/tests/apps/dockerfile-procfile-bad/worker.js @@ -0,0 +1,6 @@ +function worker() { + console.log('sleeping for 60 seconds'); + setTimeout(worker, 60 * 1000); +} + +worker(); diff --git a/tests/unit/10_git.bats b/tests/unit/10_git.bats index 45e970a18..517b25f2a 100644 --- a/tests/unit/10_git.bats +++ b/tests/unit/10_git.bats @@ -117,4 +117,4 @@ teardown() { echo "output: "$output echo "status: "$status assert_success -} \ No newline at end of file +} diff --git a/tests/unit/10_ps-dockerfile.bats b/tests/unit/10_ps-dockerfile.bats index 15f1eea16..dc002e8ad 100644 --- a/tests/unit/10_ps-dockerfile.bats +++ b/tests/unit/10_ps-dockerfile.bats @@ -166,6 +166,13 @@ teardown() { done } +@test "(ps) dockerfile with bad procfile" { + deploy_app dockerfile-procfile + echo "output: "$output + echo "status: "$status + assert_failure +} + @test "(ps:scale) dockerfile with procfile" { run bash -c "dokku ps:scale $TEST_APP web=2 worker=2" echo "output: "$output @@ -225,4 +232,3 @@ teardown() { assert_success done } - From c924bdef040e702edcfdea1117da5722073e0dc8 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 13:32:04 -0400 Subject: [PATCH 04/24] feat: expand the PORT environment variable when provided Refs #2793 Refs #3196 --- plugins/common/functions | 18 ++++---------- .../scheduler-docker-local/scheduler-deploy | 24 ++++++++++++++----- tests/unit/10_ps-general.bats | 6 ++--- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/plugins/common/functions b/plugins/common/functions index cb0a7a2af..601f8ae3c 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -394,21 +394,13 @@ get_app_running_container_types() { get_cmd_from_procfile() { declare desc="parse cmd from app Procfile" - local APP=$1; local PROC_TYPE=$2; local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE" + declare APP="$1" PROC_TYPE="$2" PORT="$3" + local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE" + local COMMAND verify_app_name "$APP" - if [[ -f $DOKKU_PROCFILE ]]; then - local line; local name; local command - while read -r line || [[ -n "$line" ]]; do - if [[ -z "$line" ]] || [[ "$line" == "#"* ]]; then - continue - fi - line=$(strip_inline_comments "$line") - name="${line%%:*}" - command="${line#*:[[:space:]]}" - [[ "$name" == "$PROC_TYPE" ]] && echo "$command" && break - done < "$DOKKU_PROCFILE" - fi + [[ ! -f $DOKKU_PROCFILE ]] && return + procfile-util show -p "$PROC_TYPE" --port "$PORT" } is_deployed() { diff --git a/plugins/scheduler-docker-local/scheduler-deploy b/plugins/scheduler-docker-local/scheduler-deploy index c4a463ae6..0291dd43f 100755 --- a/plugins/scheduler-docker-local/scheduler-deploy +++ b/plugins/scheduler-docker-local/scheduler-deploy @@ -64,12 +64,6 @@ scheduler-docker-local-scheduler-deploy() { [[ "$DOKKU_HEROKUISH" == "true" ]] && local START_CMD="/start $PROC_TYPE" - if [[ "$DOKKU_HEROKUISH" == "false" ]]; then - local DOKKU_DOCKERFILE_START_CMD=$(config_get "$APP" DOKKU_DOCKERFILE_START_CMD || true) - local DOKKU_PROCFILE_START_CMD=$(get_cmd_from_procfile "$APP" "$PROC_TYPE") - local START_CMD=${DOKKU_DOCKERFILE_START_CMD:-$DOKKU_PROCFILE_START_CMD} - fi - if [[ "$PROC_TYPE" == "web" ]]; then ports=($(plugn trigger network-compute-ports "$APP" "$PROC_TYPE" "$DOKKU_HEROKUISH")) local DOKKU_DOCKER_PORT_ARGS="" @@ -81,6 +75,8 @@ scheduler-docker-local-scheduler-deploy() { DOKKU_DOCKER_PORT_ARGS+=" -p $p " done + local START_CMD + START_CMD=$(fn-scheduler-docker-local-extract-start-cmd "$APP" "$PROC_TYPE" "$DOKKU_HEROKUISH" "$DOKKU_PORT") if [[ "$DOKKU_NETWORK_BIND_ALL" == "false" ]]; then # shellcheck disable=SC2086 cid=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d -e PORT=$DOKKU_PORT "${ARG_ARRAY[@]}" $IMAGE $START_CMD) @@ -89,6 +85,9 @@ scheduler-docker-local-scheduler-deploy() { cid=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d $DOKKU_DOCKER_PORT_ARGS -e PORT=$DOKKU_PORT "${ARG_ARRAY[@]}" $IMAGE $START_CMD) fi else + local START_CMD + START_CMD=$(fn-scheduler-docker-local-extract-start-cmd "$APP" "$PROC_TYPE" "$DOKKU_HEROKUISH") + # shellcheck disable=SC2086 cid=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d "${ARG_ARRAY[@]}" $IMAGE $START_CMD) fi @@ -177,4 +176,17 @@ scheduler-docker-local-scheduler-deploy() { fi } +fn-scheduler-docker-local-extract-start-cmd() { + declare APP="$1" PROC_TYPE="$2" DOKKU_HEROKUISH="$3" PORT="$4" + local DOKKU_DOCKERFILE_START_CMD DOKKU_PROCFILE_START_CMD START_CMD + if [[ "$DOKKU_HEROKUISH" != "false" ]]; then + return + fi + + DOKKU_DOCKERFILE_START_CMD=$(config_get "$APP" DOKKU_DOCKERFILE_START_CMD || true) + DOKKU_PROCFILE_START_CMD=$(get_cmd_from_procfile "$APP" "$PROC_TYPE" "$PORT") + START_CMD=${DOKKU_DOCKERFILE_START_CMD:-$DOKKU_PROCFILE_START_CMD} + echo "$START_CMD" +} + scheduler-docker-local-scheduler-deploy "$@" diff --git a/tests/unit/10_ps-general.bats b/tests/unit/10_ps-general.bats index c18c6a746..b43237c11 100644 --- a/tests/unit/10_ps-general.bats +++ b/tests/unit/10_ps-general.bats @@ -16,13 +16,13 @@ teardown() { source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/ps/functions" cat < "$DOKKU_ROOT/$TEST_APP/DOKKU_PROCFILE" -web: node web.js +web: node web.js --port \$PORT worker: node worker.js EOF - run get_cmd_from_procfile "$TEST_APP" web + run get_cmd_from_procfile "$TEST_APP" web 5001 echo "output: "$output echo "status: "$status - assert_output "node web.js" + assert_output "node web.js --port 5001" run get_cmd_from_procfile "$TEST_APP" worker echo "output: "$output From b6fe31f9cb06b656b4840d18a3ea41eb4cc6a9aa Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 13:59:32 -0400 Subject: [PATCH 05/24] fix: call procfile-util correctly --- plugins/common/functions | 2 +- plugins/ps/functions | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/common/functions b/plugins/common/functions index 601f8ae3c..8c572c2a5 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -400,7 +400,7 @@ get_cmd_from_procfile() { verify_app_name "$APP" [[ ! -f $DOKKU_PROCFILE ]] && return - procfile-util show -p "$PROC_TYPE" --port "$PORT" + procfile-util show --procfile "$PROC_TYPE" --default-port "$PORT" } is_deployed() { diff --git a/plugins/ps/functions b/plugins/ps/functions index beffac916..cbdba98ec 100755 --- a/plugins/ps/functions +++ b/plugins/ps/functions @@ -24,7 +24,7 @@ extract_procfile() { if [[ -f "$DOKKU_PROCFILE" ]]; then dokku_log_info1_quiet "App Procfile file found ($DOKKU_PROCFILE)" # shellcheck disable=SC2069 - PROCFILE_ERRORS="$(procfile-util check "$DOKKU_PROCFILE" 2>&1 >/dev/null || true)" + PROCFILE_ERRORS="$(procfile-util check --procfile "$DOKKU_PROCFILE" 2>&1 >/dev/null || true)" [[ -n "$PROCFILE_ERRORS" ]] && dokku_log_fail "${PROCFILE_ERRORS}" else dokku_log_info1_quiet "No Procfile found in app image" From afd101034d65fb6b1d59e15afc1fa904024f7b07 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 14:01:01 -0400 Subject: [PATCH 06/24] feat: verify that a process exists before scaling it Refs #2582 Refs #3196 --- plugins/ps/functions | 9 ++++++++- tests/unit/10_ps-dockerfile.bats | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/plugins/ps/functions b/plugins/ps/functions index cbdba98ec..1abbe0497 100755 --- a/plugins/ps/functions +++ b/plugins/ps/functions @@ -74,12 +74,18 @@ generate_scale_file() { set_scale() { declare desc="sets app proc type scaling" - local APP="$1"; local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE" + declare APP="$1" + local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE" + local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE" shift 1 + 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 + 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" dokku_log_info1_quiet "Scaling $APP:$PROC_NAME to $PROC_COUNT" if (egrep -q "^${PROC_NAME}=" "$DOKKU_SCALE_FILE" > /dev/null 2>&1); then @@ -151,6 +157,7 @@ ps_scale() { local APP="$1"; verify_app_name "$APP" local IMAGE_TAG=$(get_running_image_tag "$APP") local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE" + local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE" shift 1 [[ ! -e $DOKKU_SCALE_FILE ]] && generate_scale_file "$APP" "$IMAGE_TAG" diff --git a/tests/unit/10_ps-dockerfile.bats b/tests/unit/10_ps-dockerfile.bats index dc002e8ad..5b6d1d608 100644 --- a/tests/unit/10_ps-dockerfile.bats +++ b/tests/unit/10_ps-dockerfile.bats @@ -70,6 +70,13 @@ teardown() { done } +@test "(ps:scale) dockerfile" { + run bash -c "dokku ps:scale $TEST_APP non-existent=2" + echo "output: "$output + echo "status: "$status + assert_failure +} + @test "(ps:scale) dockerfile" { run bash -c "dokku ps:scale $TEST_APP web=2" echo "output: "$output From 0292c4ee3bf642dbf44927a5946d371be256a4cc Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 14:08:14 -0400 Subject: [PATCH 07/24] refactor: move get_cmd_from_procfile to ps/functions Procfile handling should only be performed in the ps plugin --- plugins/common/functions | 11 ----------- plugins/ps/functions | 11 +++++++++++ plugins/scheduler-docker-local/scheduler-deploy | 1 + plugins/scheduler-docker-local/scheduler-run | 2 +- tests/unit/10_ps-general.bats | 1 - 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/plugins/common/functions b/plugins/common/functions index 8c572c2a5..fa0d63835 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -392,17 +392,6 @@ get_app_running_container_types() { echo "$CONTAINER_TYPES" } -get_cmd_from_procfile() { - declare desc="parse cmd from app Procfile" - declare APP="$1" PROC_TYPE="$2" PORT="$3" - local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE" - local COMMAND - verify_app_name "$APP" - - [[ ! -f $DOKKU_PROCFILE ]] && return - procfile-util show --procfile "$PROC_TYPE" --default-port "$PORT" -} - is_deployed() { declare desc="return 0 if given app has a running container" local APP="$1" diff --git a/plugins/ps/functions b/plugins/ps/functions index 1abbe0497..c1757f18c 100755 --- a/plugins/ps/functions +++ b/plugins/ps/functions @@ -3,6 +3,17 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" +get_cmd_from_procfile() { + declare desc="parse cmd from app Procfile" + declare APP="$1" PROC_TYPE="$2" PORT="$3" + local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE" + local COMMAND + verify_app_name "$APP" + + [[ ! -f $DOKKU_PROCFILE ]] && return + procfile-util show --procfile "$DOKKU_PROCFILE" --process-type "$PROC_TYPE" --default-port "$PORT" +} + print_dokku_scale_file() { declare desc="prints contents of DOKKU_SCALE file" local APP="$1"; local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE" diff --git a/plugins/scheduler-docker-local/scheduler-deploy b/plugins/scheduler-docker-local/scheduler-deploy index 0291dd43f..655d4e4cf 100755 --- a/plugins/scheduler-docker-local/scheduler-deploy +++ b/plugins/scheduler-docker-local/scheduler-deploy @@ -3,6 +3,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_AVAILABLE_PATH/checks/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" +source "$PLUGIN_AVAILABLE_PATH/ps/functions" scheduler-docker-local-scheduler-deploy() { declare desc="deploys an image tag for a given application" diff --git a/plugins/scheduler-docker-local/scheduler-run b/plugins/scheduler-docker-local/scheduler-run index de53d95db..33929d80e 100755 --- a/plugins/scheduler-docker-local/scheduler-run +++ b/plugins/scheduler-docker-local/scheduler-run @@ -1,8 +1,8 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" -source "$PLUGIN_AVAILABLE_PATH/ps/functions" source "$PLUGIN_AVAILABLE_PATH/config/functions" +source "$PLUGIN_AVAILABLE_PATH/ps/functions" scheduler-docker-local-scheduler-run() { declare desc="runs command in container based on app image" diff --git a/tests/unit/10_ps-general.bats b/tests/unit/10_ps-general.bats index b43237c11..356cc50f4 100644 --- a/tests/unit/10_ps-general.bats +++ b/tests/unit/10_ps-general.bats @@ -13,7 +13,6 @@ teardown() { } @test "(ps:scale) procfile commands extraction" { - source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" source "$PLUGIN_CORE_AVAILABLE_PATH/ps/functions" cat < "$DOKKU_ROOT/$TEST_APP/DOKKU_PROCFILE" web: node web.js --port \$PORT From 95292bfcbac2e1c7b160612d9ffd971367135c2a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 17:55:46 -0400 Subject: [PATCH 08/24] fix: correct issue where we accidentally bailed when there was no error --- plugins/ps/functions | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/ps/functions b/plugins/ps/functions index c1757f18c..44b7648d9 100755 --- a/plugins/ps/functions +++ b/plugins/ps/functions @@ -36,7 +36,9 @@ extract_procfile() { dokku_log_info1_quiet "App Procfile file found ($DOKKU_PROCFILE)" # shellcheck disable=SC2069 PROCFILE_ERRORS="$(procfile-util check --procfile "$DOKKU_PROCFILE" 2>&1 >/dev/null || true)" - [[ -n "$PROCFILE_ERRORS" ]] && dokku_log_fail "${PROCFILE_ERRORS}" + if [[ -n "$PROCFILE_ERRORS" ]]; then + dokku_log_fail "${PROCFILE_ERRORS}" + fi else dokku_log_info1_quiet "No Procfile found in app image" fi From 0d776ec2c8122918193367b346936c1e4de6a480 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 17:55:57 -0400 Subject: [PATCH 09/24] fix: ensure we respect the herokuish start command --- plugins/scheduler-docker-local/scheduler-deploy | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/scheduler-docker-local/scheduler-deploy b/plugins/scheduler-docker-local/scheduler-deploy index 655d4e4cf..3faac4875 100755 --- a/plugins/scheduler-docker-local/scheduler-deploy +++ b/plugins/scheduler-docker-local/scheduler-deploy @@ -63,7 +63,8 @@ scheduler-docker-local-scheduler-deploy() { declare -a ARG_ARRAY eval "ARG_ARRAY=($DOCKER_ARGS)" - [[ "$DOKKU_HEROKUISH" == "true" ]] && local START_CMD="/start $PROC_TYPE" + local START_CMD + [[ "$DOKKU_HEROKUISH" == "true" ]] && START_CMD="/start $PROC_TYPE" if [[ "$PROC_TYPE" == "web" ]]; then ports=($(plugn trigger network-compute-ports "$APP" "$PROC_TYPE" "$DOKKU_HEROKUISH")) @@ -76,8 +77,7 @@ scheduler-docker-local-scheduler-deploy() { DOKKU_DOCKER_PORT_ARGS+=" -p $p " done - local START_CMD - START_CMD=$(fn-scheduler-docker-local-extract-start-cmd "$APP" "$PROC_TYPE" "$DOKKU_HEROKUISH" "$DOKKU_PORT") + START_CMD=$(fn-scheduler-docker-local-extract-start-cmd "$APP" "$PROC_TYPE" "$START_CMD" "$DOKKU_HEROKUISH" "$DOKKU_PORT") if [[ "$DOKKU_NETWORK_BIND_ALL" == "false" ]]; then # shellcheck disable=SC2086 cid=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d -e PORT=$DOKKU_PORT "${ARG_ARRAY[@]}" $IMAGE $START_CMD) @@ -86,8 +86,7 @@ scheduler-docker-local-scheduler-deploy() { cid=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d $DOKKU_DOCKER_PORT_ARGS -e PORT=$DOKKU_PORT "${ARG_ARRAY[@]}" $IMAGE $START_CMD) fi else - local START_CMD - START_CMD=$(fn-scheduler-docker-local-extract-start-cmd "$APP" "$PROC_TYPE" "$DOKKU_HEROKUISH") + START_CMD=$(fn-scheduler-docker-local-extract-start-cmd "$APP" "$PROC_TYPE" "$START_CMD" "$DOKKU_HEROKUISH") # shellcheck disable=SC2086 cid=$(docker run $DOKKU_GLOBAL_RUN_ARGS -d "${ARG_ARRAY[@]}" $IMAGE $START_CMD) @@ -178,9 +177,10 @@ scheduler-docker-local-scheduler-deploy() { } fn-scheduler-docker-local-extract-start-cmd() { - declare APP="$1" PROC_TYPE="$2" DOKKU_HEROKUISH="$3" PORT="$4" + declare APP="$1" PROC_TYPE="$2" START_CMD="$3" DOKKU_HEROKUISH="$4" PORT="$5" local DOKKU_DOCKERFILE_START_CMD DOKKU_PROCFILE_START_CMD START_CMD if [[ "$DOKKU_HEROKUISH" != "false" ]]; then + echo "$START_CMD" return fi From 7f6688c01adbe8548ce6aa3d7e8040f481e1475b Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 29 Jul 2018 20:13:44 -0400 Subject: [PATCH 10/24] hack: log the procfile and more --- plugins/ps/functions | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/ps/functions b/plugins/ps/functions index 44b7648d9..2f90d5535 100755 --- a/plugins/ps/functions +++ b/plugins/ps/functions @@ -34,11 +34,14 @@ extract_procfile() { copy_from_image "$IMAGE" "Procfile" "$DOKKU_PROCFILE" 2>/dev/null || true if [[ -f "$DOKKU_PROCFILE" ]]; then dokku_log_info1_quiet "App Procfile file found ($DOKKU_PROCFILE)" + cat "$DOKKU_PROCFILE" + set -x # shellcheck disable=SC2069 PROCFILE_ERRORS="$(procfile-util check --procfile "$DOKKU_PROCFILE" 2>&1 >/dev/null || true)" if [[ -n "$PROCFILE_ERRORS" ]]; then dokku_log_fail "${PROCFILE_ERRORS}" fi + set +x else dokku_log_info1_quiet "No Procfile found in app image" fi From 0abc40ecca1d017e6e82229a1ce62509730022b5 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 18 Aug 2018 10:20:00 -0500 Subject: [PATCH 11/24] fix: use correct version of go-procfile-util --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index df092c880..39327fef1 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ DOKKU_VERSION ?= master SSHCOMMAND_URL ?= https://raw.githubusercontent.com/dokku/sshcommand/v0.7.0/sshcommand -PROCFILE_UTIL_URL ?= https://github.com/josegonzalez/go-procfile-util/releases/download/v0.2.0/procfile-util_0.2.0_linux_x86_64.tgz +PROCFILE_UTIL_URL ?= https://github.com/josegonzalez/go-procfile-util/releases/download/v0.4.0/procfile-util_0.4.0_linux_x86_64.tgz PLUGN_URL ?= https://github.com/dokku/plugn/releases/download/v0.3.0/plugn_0.3.0_linux_x86_64.tgz SIGIL_URL ?= https://github.com/gliderlabs/sigil/releases/download/v0.4.0/sigil_0.4.0_Linux_x86_64.tgz STACK_URL ?= https://github.com/gliderlabs/herokuish.git From 01a4440f390810ef233f66998e016a3008c4363e Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 19 Aug 2018 03:50:52 -0400 Subject: [PATCH 12/24] fix: use correct test app --- tests/unit/10_ps-dockerfile.bats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/10_ps-dockerfile.bats b/tests/unit/10_ps-dockerfile.bats index 5b6d1d608..1d7ff8862 100644 --- a/tests/unit/10_ps-dockerfile.bats +++ b/tests/unit/10_ps-dockerfile.bats @@ -174,7 +174,7 @@ teardown() { } @test "(ps) dockerfile with bad procfile" { - deploy_app dockerfile-procfile + deploy_app dockerfile-procfile-bad echo "output: "$output echo "status: "$status assert_failure From 81935a8f311aba6177574ec737c09a049f4a55f7 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 19 Aug 2018 21:01:51 -0400 Subject: [PATCH 13/24] feat: drop debugging info --- plugins/ps/functions | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/ps/functions b/plugins/ps/functions index 2f90d5535..48f9ed7cb 100755 --- a/plugins/ps/functions +++ b/plugins/ps/functions @@ -34,14 +34,11 @@ extract_procfile() { copy_from_image "$IMAGE" "Procfile" "$DOKKU_PROCFILE" 2>/dev/null || true if [[ -f "$DOKKU_PROCFILE" ]]; then dokku_log_info1_quiet "App Procfile file found ($DOKKU_PROCFILE)" - cat "$DOKKU_PROCFILE" - set -x # shellcheck disable=SC2069 - PROCFILE_ERRORS="$(procfile-util check --procfile "$DOKKU_PROCFILE" 2>&1 >/dev/null || true)" + PROCFILE_ERRORS="$(procfile-util check --procfile "$DOKKU_PROCFILE" 2>&1 >/dev/null || true)" if [[ -n "$PROCFILE_ERRORS" ]]; then dokku_log_fail "${PROCFILE_ERRORS}" fi - set +x else dokku_log_info1_quiet "No Procfile found in app image" fi From 2ec99bc85381eef2ce3f4c5f06c39dd70e887b5f Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 19 Aug 2018 21:33:28 -0400 Subject: [PATCH 14/24] hack: create the application after it gets destroyed --- tests/unit/10_ps-dockerfile.bats | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/unit/10_ps-dockerfile.bats b/tests/unit/10_ps-dockerfile.bats index 1d7ff8862..513c32141 100644 --- a/tests/unit/10_ps-dockerfile.bats +++ b/tests/unit/10_ps-dockerfile.bats @@ -70,7 +70,7 @@ teardown() { done } -@test "(ps:scale) dockerfile" { +@test "(ps:scale) dockerfile non-existent process" { run bash -c "dokku ps:scale $TEST_APP non-existent=2" echo "output: "$output echo "status: "$status @@ -178,6 +178,9 @@ teardown() { echo "output: "$output echo "status: "$status assert_failure + + create_app + assert_success } @test "(ps:scale) dockerfile with procfile" { From 64c6437e4eaf21d28847edcb438573f82d01a23a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 25 Aug 2018 11:54:36 -0400 Subject: [PATCH 15/24] hack: pull procfile if possible when setting ps:scale --- plugins/ps/functions | 5 ++++- tests/unit/10_ps-dockerfile.bats | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) 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 From d63f1cc1580b1ff451bac455ec7a2d2b3f1af282 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 3 Sep 2018 17:26:13 -0400 Subject: [PATCH 16/24] fix: expand variables --- tests/unit/10_ps-dockerfile.bats | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/10_ps-dockerfile.bats b/tests/unit/10_ps-dockerfile.bats index cd7329c6f..29e9d39ee 100644 --- a/tests/unit/10_ps-dockerfile.bats +++ b/tests/unit/10_ps-dockerfile.bats @@ -72,8 +72,8 @@ teardown() { @test "(ps:scale) dockerfile non-existent process" { run bash -c "dokku --trace ps:scale $TEST_APP non-existent=2" - echo "output: "$output - echo "status: "$status + echo "output: $output" + echo "status: $status" assert_failure } From cb0ad13278525dd0bf2db456ce757d7cabab8a1b Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 3 Sep 2018 17:32:54 -0400 Subject: [PATCH 17/24] fix: proc check only works when there is Procfile available --- tests/unit/10_ps-dockerfile.bats | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/unit/10_ps-dockerfile.bats b/tests/unit/10_ps-dockerfile.bats index 29e9d39ee..fcb068b32 100644 --- a/tests/unit/10_ps-dockerfile.bats +++ b/tests/unit/10_ps-dockerfile.bats @@ -71,6 +71,14 @@ teardown() { } @test "(ps:scale) dockerfile non-existent process" { + run bash -c "dokku --trace ps:scale $TEST_APP non-existent=2" + echo "output: $output" + echo "status: $status" + assert_success + + destroy_app + create_app + deploy_app dockerfile run bash -c "dokku --trace ps:scale $TEST_APP non-existent=2" echo "output: $output" echo "status: $status" From 5e065830556d562ffef755944fea95ac621f31dd Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 3 Sep 2018 17:37:25 -0400 Subject: [PATCH 18/24] feat: trace --- tests/unit/10_ps-herokuish.bats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/10_ps-herokuish.bats b/tests/unit/10_ps-herokuish.bats index debb1cb35..4f9397096 100644 --- a/tests/unit/10_ps-herokuish.bats +++ b/tests/unit/10_ps-herokuish.bats @@ -87,7 +87,7 @@ teardown() { assert_success done - run bash -c "dokku ps:scale $TEST_APP web=1 worker=1" + run bash -c "dokku --trace ps:scale $TEST_APP web=1 worker=1" echo "output: "$output echo "status: "$status assert_success From aee8b8b65957918804088c0001ade5d9003740d3 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 6 Oct 2018 18:21:53 -0400 Subject: [PATCH 19/24] fix: use correct app when testing scaling of non-existent process types --- tests/unit/10_ps-dockerfile.bats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/10_ps-dockerfile.bats b/tests/unit/10_ps-dockerfile.bats index fcb068b32..62aee0feb 100644 --- a/tests/unit/10_ps-dockerfile.bats +++ b/tests/unit/10_ps-dockerfile.bats @@ -78,7 +78,7 @@ teardown() { destroy_app create_app - deploy_app dockerfile + deploy_app dockerfile-procfile run bash -c "dokku --trace ps:scale $TEST_APP non-existent=2" echo "output: $output" echo "status: $status" From f992156dcf88a60e2528762207eee297c0c1f13e Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 6 Oct 2018 18:51:15 -0400 Subject: [PATCH 20/24] fix: use run for testing failed deploy_app --- tests/unit/10_ps-dockerfile.bats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/10_ps-dockerfile.bats b/tests/unit/10_ps-dockerfile.bats index 62aee0feb..4f37e4295 100644 --- a/tests/unit/10_ps-dockerfile.bats +++ b/tests/unit/10_ps-dockerfile.bats @@ -182,7 +182,7 @@ teardown() { } @test "(ps) dockerfile with bad procfile" { - deploy_app dockerfile-procfile-bad + run deploy_app dockerfile-procfile-bad echo "output: "$output echo "status: "$status assert_failure From 6f2e2d6aad1ed4ce60b4c908dcbb890a8bd2e80f Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 11 Oct 2018 20:19:54 -0400 Subject: [PATCH 21/24] chore: ensure the output gets formatted correctly --- tests/unit/10_ps-herokuish.bats | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 tests/unit/10_ps-herokuish.bats diff --git a/tests/unit/10_ps-herokuish.bats b/tests/unit/10_ps-herokuish.bats old mode 100644 new mode 100755 index 4f9397096..95acfd125 --- a/tests/unit/10_ps-herokuish.bats +++ b/tests/unit/10_ps-herokuish.bats @@ -88,8 +88,8 @@ teardown() { done run bash -c "dokku --trace ps:scale $TEST_APP web=1 worker=1" - echo "output: "$output - echo "status: "$status + echo "output: $output" + echo "status: $status" assert_success for PROC_TYPE in web worker; do CIDS="" From 05240c56b678b024d6dc4b64f8ceb11880eab048 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 13 Oct 2018 20:17:51 -0400 Subject: [PATCH 22/24] fix: reference correct variable for procfile --- plugins/ps/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ps/functions b/plugins/ps/functions index d550b8bdd..2682aedb1 100755 --- a/plugins/ps/functions +++ b/plugins/ps/functions @@ -99,7 +99,7 @@ set_scale() { for procscale in "${SCALE_SETTINGS[@]}"; do local PROC_NAME=${procscale%%=*} local PROC_COUNT=${procscale#*=} - if [[ -f "$DOKKU_PROCFILE" ]] && ! procfile-util exists --procfile "$DOKKU_SCALE_FILE" --process-type "$PROC_NAME" > /dev/null 2>&1; then + if [[ -f "$DOKKU_PROCFILE" ]] && ! procfile-util exists --procfile "$DOKKU_PROCFILE" --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" From 059d3dc159ca0fefbc4ae3cef3ca07ef439063db Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 13 Oct 2018 23:31:11 -0400 Subject: [PATCH 23/24] fix: call run in order to override globals --- tests/unit/10_ps-dockerfile.bats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/10_ps-dockerfile.bats b/tests/unit/10_ps-dockerfile.bats index 4f37e4295..edbe83a7e 100644 --- a/tests/unit/10_ps-dockerfile.bats +++ b/tests/unit/10_ps-dockerfile.bats @@ -187,7 +187,7 @@ teardown() { echo "status: "$status assert_failure - create_app + run create_app assert_success } From fd8d27d83795e96081208d730669a7ca3c95281a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 14 Oct 2018 00:16:55 -0400 Subject: [PATCH 24/24] revert: permission and trace --- tests/unit/10_ps-dockerfile.bats | 4 ++-- tests/unit/10_ps-herokuish.bats | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) mode change 100755 => 100644 tests/unit/10_ps-herokuish.bats diff --git a/tests/unit/10_ps-dockerfile.bats b/tests/unit/10_ps-dockerfile.bats index edbe83a7e..205014fcf 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 --trace ps:scale $TEST_APP non-existent=2" + run bash -c "dokku ps:scale $TEST_APP non-existent=2" echo "output: $output" echo "status: $status" assert_success @@ -79,7 +79,7 @@ teardown() { destroy_app create_app deploy_app dockerfile-procfile - run bash -c "dokku --trace ps:scale $TEST_APP non-existent=2" + run bash -c "dokku ps:scale $TEST_APP non-existent=2" echo "output: $output" echo "status: $status" assert_failure diff --git a/tests/unit/10_ps-herokuish.bats b/tests/unit/10_ps-herokuish.bats old mode 100755 new mode 100644 index 95acfd125..debb1cb35 --- a/tests/unit/10_ps-herokuish.bats +++ b/tests/unit/10_ps-herokuish.bats @@ -87,9 +87,9 @@ teardown() { assert_success done - run bash -c "dokku --trace ps:scale $TEST_APP web=1 worker=1" - echo "output: $output" - echo "status: $status" + run bash -c "dokku ps:scale $TEST_APP web=1 worker=1" + echo "output: "$output + echo "status: "$status assert_success for PROC_TYPE in web worker; do CIDS=""