Skip to content

Commit

Permalink
COSI-53: update-cmds-to-print-in-github-ui-and-log
Browse files Browse the repository at this point in the history
  • Loading branch information
anurag4DSB committed Jan 2, 2025
1 parent 0404900 commit 9c4e7f0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/cleanup_cosi_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trap 'error_handler' ERR

log_and_run() {
echo "Running: $*" | tee -a "$LOG_FILE"
"$@" | tee -a "$LOG_FILE"
"$@" 2>&1 | tee -a "$LOG_FILE"
}

log_and_run echo "Removing COSI driver manifests and namespace..."
Expand Down
5 changes: 4 additions & 1 deletion .github/scripts/e2e_tests_greenfield_use_case.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ trap 'error_handler' ERR
# Log command execution to the log file for debugging
log_and_run() {
echo "Running: $*" | tee -a "$LOG_FILE"
"$@" | tee -a "$LOG_FILE"
if ! "$@" 2>&1 | tee -a "$LOG_FILE"; then
echo "Error: Command failed - $*" | tee -a "$LOG_FILE"
exit 1
fi
}

# Step 1: Create Account in Vault
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/setup_cosi_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ trap 'error_handler' ERR
# Log command execution to the log file for debugging
log_and_run() {
echo "Running: $*" | tee -a "$LOG_FILE"
if ! "$@" | tee -a "$LOG_FILE"; then
if ! "$@" 2>&1 | tee -a "$LOG_FILE"; then
echo "Error: Command failed - $*" | tee -a "$LOG_FILE"
exit 1
fi
Expand Down

0 comments on commit 9c4e7f0

Please sign in to comment.