Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API-1835: Archive the output dir when MOM command fails #97

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions scripts/test-operator-integration.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail
set -x
Expand Down Expand Up @@ -40,4 +39,12 @@ APPLY_CONFIG_ARGS=(
)

# Run the apply-configuration command from the operator
"${MOM_CMD}" "${APPLY_CONFIG_ARGS[@]}"
if ! "${MOM_CMD}" "${APPLY_CONFIG_ARGS[@]}"; then
# If the command fails, create an archive for easy downloading
TMP_DIR="$(mktemp -d)"
ARCHIVE_PATH="${TMP_DIR}/archive.tar.gz"
tar -czf "${ARCHIVE_PATH}" -C "${APPLY_CONFIG_OUTPUT_DIR}" .
mv "${ARCHIVE_PATH}" "${APPLY_CONFIG_OUTPUT_DIR}"
rmdir "${TMP_DIR}"
exit 1
fi