Skip to content

Commit

Permalink
Make t3c debugging shim inherit the CDN in a Box environment
Browse files Browse the repository at this point in the history
  • Loading branch information
zrhoffman committed Jul 14, 2023
1 parent db67a94 commit ab2d7f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions infrastructure/cdn-in-a-box/cache/init-debug-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@

set -o errexit -o nounset

export_environment() {
while IFS= read -r line; do
export "$line";
done < <(sed '/#/d' /ciab.env)
}

maybe_debug() {
set -o errexit -o nounset
hostname="$1"
Expand Down Expand Up @@ -47,7 +53,9 @@ for t3c_tool in $(compgen -c t3c | sort | uniq); do
actual_binary="${t3c_tool}.actual"
<<-DLV_SCRIPT cat > "$dlv_script"
#!/usr/bin/env bash
$(type export_environment | tail -n+2)
$(type maybe_debug | tail -n+2)
export_environment
maybe_debug "${hostname}" "${DEBUG_PORT}" "${actual_binary}" "\$@"
DLV_SCRIPT
chmod +x "$dlv_script"
Expand Down
3 changes: 3 additions & 0 deletions infrastructure/cdn-in-a-box/cache/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
trap 'echo "Error on line ${LINENO} of ${0}"; exit 1' ERR
set -o errexit -o nounset -o pipefail -o xtrace -o monitor

# Needed because on Rocky Linux, cron jobs do not inherit the environment
env > /ciab.env

set_profile_parameter() {
local profile_file="$1" config_file="$2" name="$3" new_value="$4" human_readable="$5"
jq=(jq --arg CONFIG_FILE "$config_file" --arg NAME "$name" --arg NEW_VALUE "$new_value")
Expand Down

0 comments on commit ab2d7f3

Please sign in to comment.