From 72f1a8545915bb36a60a91fa4ccfb6cf35275849 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 5 Jul 2016 02:37:50 -0400 Subject: [PATCH] Use the deployed image name when running deploy tasks or running arbitrary commands This ensures the proper image is in use, regardless of the phase in which dokku creates a docker container. --- plugins/00_dokku-standard/exec-app-json-scripts | 2 +- plugins/00_dokku-standard/subcommands/run | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/00_dokku-standard/exec-app-json-scripts b/plugins/00_dokku-standard/exec-app-json-scripts index 3f7700fa7..68399a51f 100755 --- a/plugins/00_dokku-standard/exec-app-json-scripts +++ b/plugins/00_dokku-standard/exec-app-json-scripts @@ -23,7 +23,7 @@ get_phase_script() { execute_script() { declare desc="executes appropriate phase script key from app.json" - local APP="$1"; local IMAGE_TAG="$2"; local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG") + local APP="$1"; local IMAGE_TAG="$2"; local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG") local PHASE_SCRIPT_KEY="$3" local SCRIPT_CMD=$(get_phase_script "$IMAGE" "$PHASE_SCRIPT_KEY" 2>/dev/null) if [[ -n "$SCRIPT_CMD" ]];then diff --git a/plugins/00_dokku-standard/subcommands/run b/plugins/00_dokku-standard/subcommands/run index fc06ac9e3..4a0d04d66 100755 --- a/plugins/00_dokku-standard/subcommands/run +++ b/plugins/00_dokku-standard/subcommands/run @@ -8,7 +8,7 @@ dokku_run_cmd() { declare desc="runs command in container based on app image" local cmd="run" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" - local APP="$2"; local IMAGE_TAG=$(get_running_image_tag "$APP"); local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG") + local APP="$2"; local IMAGE_TAG=$(get_running_image_tag "$APP"); local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG") verify_app_name "$APP" shift 2