Skip to content

Commit

Permalink
Adding logging to troubleshoot bash script
Browse files Browse the repository at this point in the history
  • Loading branch information
bhagatparwinder committed Oct 22, 2024
1 parent ef148cb commit de30bc6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/cclf-import-test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,17 @@ jobs:
FILENAME: ${{needs.trigger.outputs.filename}}
# CAUTION: if changing the script below, validate that sensitive information is not printed in the workflow
run: |
log() {
local level="$1"
shift
echo "[$(date '+%Y-%m-%d %H:%M:%S')] [$level] $*"
}
HOST=$(aws rds describe-db-instances --db-instance-identifier bcda-test-rds 2>&1 | jq -r '.DBInstances[0].Endpoint.Address' 2>&1)
log "DEBUG" "Retrieved host: $HOST"
CONNECTION_URL=$(echo $CONNECTION_INFO 2>&1 | sed -E "s/@.*\/bcda/\@$HOST\/bcda/" 2>&1)
log "DEBUG" "Updated connection URL: $CONNECTION_URL"
# Verify that we have a record of the CCLF file in the database
CCLF_FILE=`psql -t "$CONNECTION_URL" -c "SELECT id FROM cclf_files WHERE name = '$FILENAME' LIMIT 1" 2>&1`
Expand Down

0 comments on commit de30bc6

Please sign in to comment.