feat: redirect output in every case as appropriate
This commit is contained in:
4 files changed
+30
-1
No files matched your search
@@ -188,7 +188,8 @@ execute_dokku_cmd() {
|
|||||||
set -- "$PLUGIN_CMD" "$@"
|
set -- "$PLUGIN_CMD" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $PLUGIN_NAME =~ git-* ]] || [[ $PLUGIN_NAME =~ git:* ]]; then
|
if [[ $PLUGIN_NAME =~ git-* ]] || [[ "$PLUGIN_NAME" == "ps:rebuild" ]] || [[ "$PLUGIN_NAME" == "ps:restart" ]] || [[ "$PLUGIN_NAME" == "deploy" ]]; then
|
||||||
|
export DOKKU_REDIRECT_OUTPUT=true
|
||||||
exec &> >(tee >(tee | logger -i -t "dokku-${DOKKU_PID}"))
|
exec &> >(tee >(tee | logger -i -t "dokku-${DOKKU_PID}"))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -626,6 +626,11 @@ release_and_deploy() {
|
|||||||
declare desc="main function for releasing and deploying an app"
|
declare desc="main function for releasing and deploying an app"
|
||||||
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
||||||
|
|
||||||
|
if [[ "$DOKKU_REDIRECT_OUTPUT" != "true" ]]; then
|
||||||
|
export DOKKU_REDIRECT_OUTPUT=true
|
||||||
|
exec &> >(tee >(tee | logger -i -t "dokku-${DOKKU_PID}"))
|
||||||
|
fi
|
||||||
|
|
||||||
local APP="$1"
|
local APP="$1"
|
||||||
local IMAGE_TAG="${2:-latest}"
|
local IMAGE_TAG="${2:-latest}"
|
||||||
local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
|
local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
|
||||||
|
|||||||
@@ -52,6 +52,10 @@ cmd-git-from-archive() {
|
|||||||
dokku_log_fail "Invalid archive type specified, valid archive types include: tar, tar.gz, zip"
|
dokku_log_fail "Invalid archive type specified, valid archive types include: tar, tar.gz, zip"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$DOKKU_REDIRECT_OUTPUT" != "true" ]]; then
|
||||||
|
export DOKKU_REDIRECT_OUTPUT=true
|
||||||
|
exec &> >(tee >(tee | logger -i -t "dokku-${DOKKU_PID}"))
|
||||||
|
fi
|
||||||
plugn trigger git-from-archive "$APP" "$ARCHIVE_URL" "$ARCHIVE_TYPE" "$USER_NAME" "$USER_EMAIL"
|
plugn trigger git-from-archive "$APP" "$ARCHIVE_URL" "$ARCHIVE_TYPE" "$USER_NAME" "$USER_EMAIL"
|
||||||
plugn trigger deploy-source-set "$APP" "$ARCHIVE_TYPE" "$ARCHIVE_URL"
|
plugn trigger deploy-source-set "$APP" "$ARCHIVE_TYPE" "$ARCHIVE_URL"
|
||||||
}
|
}
|
||||||
@@ -162,6 +166,10 @@ cmd-git-load-image() {
|
|||||||
[[ -z "$DOCKER_IMAGE" ]] && dokku_log_fail "Please specify a docker image"
|
[[ -z "$DOCKER_IMAGE" ]] && dokku_log_fail "Please specify a docker image"
|
||||||
[[ ! -t 0 ]] || dokku_log_fail "Expecting tar archive containing docker image on STDIN"
|
[[ ! -t 0 ]] || dokku_log_fail "Expecting tar archive containing docker image on STDIN"
|
||||||
|
|
||||||
|
if [[ "$DOKKU_REDIRECT_OUTPUT" != "true" ]]; then
|
||||||
|
export DOKKU_REDIRECT_OUTPUT=true
|
||||||
|
exec &> >(tee >(tee | logger -i -t "dokku-${DOKKU_PID}"))
|
||||||
|
fi
|
||||||
cat | docker load
|
cat | docker load
|
||||||
|
|
||||||
if ! verify_image "$DOCKER_IMAGE"; then
|
if ! verify_image "$DOCKER_IMAGE"; then
|
||||||
@@ -215,6 +223,11 @@ cmd-git-from-image() {
|
|||||||
export DOKKU_APPS_FORCE_DELETE=1
|
export DOKKU_APPS_FORCE_DELETE=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$DOKKU_REDIRECT_OUTPUT" != "true" ]]; then
|
||||||
|
export DOKKU_REDIRECT_OUTPUT=true
|
||||||
|
exec &> >(tee >(tee | logger -i -t "dokku-${DOKKU_PID}"))
|
||||||
|
fi
|
||||||
|
|
||||||
if ! plugn trigger git-from-image "$APP" "$DOCKER_IMAGE" "$BUILD_DIR" "$USER_NAME" "$USER_EMAIL"; then
|
if ! plugn trigger git-from-image "$APP" "$DOCKER_IMAGE" "$BUILD_DIR" "$USER_NAME" "$USER_EMAIL"; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -263,6 +276,11 @@ cmd-git-sync() {
|
|||||||
DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")"
|
DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")"
|
||||||
CURRENT_REF="$(fn-git-cmd "$APP_ROOT" rev-parse "$DOKKU_DEPLOY_BRANCH" 2>/dev/null || true)"
|
CURRENT_REF="$(fn-git-cmd "$APP_ROOT" rev-parse "$DOKKU_DEPLOY_BRANCH" 2>/dev/null || true)"
|
||||||
|
|
||||||
|
if [[ "$DOKKU_REDIRECT_OUTPUT" != "true" ]]; then
|
||||||
|
export DOKKU_REDIRECT_OUTPUT=true
|
||||||
|
exec &> >(tee >(tee | logger -i -t "dokku-${DOKKU_PID}"))
|
||||||
|
fi
|
||||||
|
|
||||||
if ! fn-git-cmd "$APP_ROOT" rev-parse "$DOKKU_DEPLOY_BRANCH" &>/dev/null; then
|
if ! fn-git-cmd "$APP_ROOT" rev-parse "$DOKKU_DEPLOY_BRANCH" &>/dev/null; then
|
||||||
dokku_log_info1_quiet "Cloning $APP from $GIT_REMOTE#$GIT_REF"
|
dokku_log_info1_quiet "Cloning $APP from $GIT_REMOTE#$GIT_REF"
|
||||||
fn-git-clone "$APP" "$GIT_REMOTE" "$GIT_REF" "$SKIP_DEPLOY_BRANCH"
|
fn-git-clone "$APP" "$GIT_REMOTE" "$GIT_REF" "$SKIP_DEPLOY_BRANCH"
|
||||||
|
|||||||
@@ -7,6 +7,11 @@ trigger-git-receive-app() {
|
|||||||
declare desc="builds the app from the local git repository"
|
declare desc="builds the app from the local git repository"
|
||||||
declare trigger="receive-app"
|
declare trigger="receive-app"
|
||||||
|
|
||||||
|
if [[ "$DOKKU_REDIRECT_OUTPUT" != "true" ]]; then
|
||||||
|
export DOKKU_REDIRECT_OUTPUT=true
|
||||||
|
exec &> >(tee >(tee | logger -i -t "dokku-${DOKKU_PID}"))
|
||||||
|
fi
|
||||||
|
|
||||||
git_receive_app "$@"
|
git_receive_app "$@"
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user