fix: pass along failed build status when building from image

This commit is contained in:
Jose Diaz-Gonzalez
2022-04-16 02:44:51 -04:00
parent ba7c685e11
commit 49d08a8fb6
2 changed files with 7 additions and 3 deletions

View File

@@ -157,7 +157,7 @@ dokku_log_fail_quiet() {
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
echo " ! $*" 1>&2
fi
exit ${DOKKU_FAIL_EXIT_CODE:=1}
exit "${DOKKU_FAIL_EXIT_CODE:=1}"
}
dokku_log_fail() {
@@ -708,7 +708,9 @@ dokku_receive() {
fi
DOKKU_QUIET_OUTPUT=1 config_set --no-restart "$APP" DOKKU_APP_TYPE="$IMAGE_SOURCE_TYPE"
dokku_build "$APP" "$IMAGE_SOURCE_TYPE" "$TMP_WORK_DIR"
if ! dokku_build "$APP" "$IMAGE_SOURCE_TYPE" "$TMP_WORK_DIR"; then
return 1
fi
plugn trigger release-and-deploy "$APP"
}

View File

@@ -110,7 +110,9 @@ cmd-git-from-image() {
verify_app_name "$APP"
[[ -z "$DOCKER_IMAGE" ]] && dokku_log_fail "Please specify a docker image"
plugn trigger git-from-image "$APP" "$DOCKER_IMAGE" "$BUILD_DIR" "$USER_NAME" "$USER_EMAIL"
if ! plugn trigger git-from-image "$APP" "$DOCKER_IMAGE" "$BUILD_DIR" "$USER_NAME" "$USER_EMAIL"; then
return 1
fi
plugn trigger deploy-source-set "$APP" "docker-image" "$DOCKER_IMAGE"
}