Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ jobs:
sudo systemctl stop ibkr-gateway-healthcheck.timer ibkr-gateway-healthcheck.service 2>/dev/null || true
sudo bash ./scripts/ensure_host_swap.sh
sudo bash ./scripts/install_2fa_bot_watcher.sh
sudo bash ./scripts/install_gateway_health_watcher.sh
sudo bash ./scripts/recover_ib_gateway_ready.sh '${IB_GATEWAY_MODE}'
sudo bash ./scripts/install_gateway_health_watcher.sh
sudo docker compose ps
sudo systemctl status ibkr-2fa-bot.timer --no-pager
sudo systemctl status ibkr-gateway-healthcheck.timer --no-pager
Expand All @@ -372,8 +372,8 @@ jobs:
sudo docker compose up -d

sudo bash ./scripts/install_2fa_bot_watcher.sh
sudo bash ./scripts/install_gateway_health_watcher.sh
sudo bash ./scripts/recover_ib_gateway_ready.sh '${IB_GATEWAY_MODE}'
sudo bash ./scripts/install_gateway_health_watcher.sh
sudo docker compose ps
sudo systemctl status ibkr-2fa-bot.timer --no-pager
sudo systemctl status ibkr-gateway-healthcheck.timer --no-pager
Expand Down
12 changes: 12 additions & 0 deletions tests/test_workflow_shared_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ grep -Fq "sudo bash ./scripts/recover_ib_gateway_ready.sh '\${IB_GATEWAY_MODE}'"
grep -Fq 'sudo systemctl status ibkr-gateway-healthcheck.timer --no-pager' "$workflow_file"
grep -Fq 'sudo systemctl status ibkr-gateway-daily-restart.timer --no-pager' "$workflow_file"
grep -Fq 'Full deploy mode: rebuilding container' "$workflow_file"

mapfile -t recover_lines < <(grep -nF "sudo bash ./scripts/recover_ib_gateway_ready.sh '\${IB_GATEWAY_MODE}'" "$workflow_file" | cut -d: -f1)
mapfile -t health_watcher_lines < <(grep -nF 'sudo bash ./scripts/install_gateway_health_watcher.sh' "$workflow_file" | cut -d: -f1)
test "${#recover_lines[@]}" -eq 2
test "${#health_watcher_lines[@]}" -eq 2
for i in 0 1; do
if [ "${recover_lines[$i]}" -ge "${health_watcher_lines[$i]}" ]; then
echo "Gateway health watcher must be installed after explicit recovery in deploy block $i" >&2
exit 1
fi
done

grep -Fq '"TRADING_MODE": os.environ["IB_GATEWAY_MODE"]' "$workflow_file"
grep -Fq '"ACCEPT_API_FROM_IP": os.environ["CLOUD_RUN_EGRESS_CIDR"]' "$workflow_file"
grep -Fq 'REMOTE_DEPLOY_COMMAND=$(cat <<EOF' "$workflow_file"
Expand Down