Merge pull request #3004 from dokku/2916-fail-on-invalid-image
fix: return/exit 1 when an image being deployed is invalid
This commit is contained in:
2 files changed
+12
-2
No files matched your search
@@ -6,10 +6,13 @@ source "$PLUGIN_AVAILABLE_PATH/tags/functions"
|
|||||||
tags_deploy_cmd() {
|
tags_deploy_cmd() {
|
||||||
declare desc="deploys an app with a given tagged image via command line"
|
declare desc="deploys an app with a given tagged image via command line"
|
||||||
local cmd="tags:deploy"
|
local cmd="tags:deploy"
|
||||||
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
|
declare APP="$2" IMAGE_TAG="$3"
|
||||||
local APP="$2"; local IMAGE_TAG="$3"
|
local IMAGE
|
||||||
|
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
|
|
||||||
|
IMAGE="$(get_app_image_name "$APP" "$IMAGE_TAG")"
|
||||||
|
verify_image "$IMAGE" || return 1
|
||||||
release_and_deploy "$APP" "$IMAGE_TAG"
|
release_and_deploy "$APP" "$IMAGE_TAG"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,3 +46,10 @@ teardown() {
|
|||||||
echo "status: "$status
|
echo "status: "$status
|
||||||
assert_success
|
assert_success
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "(tags) tags:deploy (missing tag)" {
|
||||||
|
run /bin/bash -c "dokku tags:deploy $TEST_APP missing-tag"
|
||||||
|
echo "output: "$output
|
||||||
|
echo "status: "$status
|
||||||
|
assert_failure
|
||||||
|
}
|
||||||
Reference in new issue
Block a user