Skip to content

Commit

Permalink
print command in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
anurag4DSB committed Dec 23, 2024
1 parent 042a729 commit e7ce40e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/scripts/cleanup_cosi_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ error_handler() {
trap 'error_handler' ERR

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

Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/e2e_tests_brownfield_use_case.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ error_handler() {
# Trap errors and call the error handler
trap 'error_handler' ERR

# Log command execution to the log file for debugging
log_and_run() {
echo "Running: $*" | tee -a "$LOG_FILE"
"$@" 2>&1 | tee -a "$LOG_FILE"
}

Expand Down
7 changes: 5 additions & 2 deletions .github/scripts/e2e_tests_greenfield_use_case.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ error_handler() {
# Trap errors and call the error handler
trap 'error_handler' ERR

# Log command execution to the log file for debugging
log_and_run() {
"$@" 2>&1 | tee -a "$LOG_FILE"
echo "Running: $*" | 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
1 change: 1 addition & 0 deletions .github/scripts/setup_cosi_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ trap 'error_handler' ERR

# Log command execution to the log file for debugging
log_and_run() {
echo "Running: $*" | tee -a "$LOG_FILE"
if ! "$@" 2>&1 | tee -a "$LOG_FILE"; then
echo "Error: Command failed - $*" | tee -a "$LOG_FILE"
exit 1
Expand Down

0 comments on commit e7ce40e

Please sign in to comment.