Skip to content
Merged
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
32 changes: 32 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,38 @@ jobs:
echo "Kubernetes state backend access verified."
# Verify OpenTofu can access existing TEST remote state.
- name: Verify TEST remote state
shell: bash
run: |
set -euo pipefail
for STACK in network frontend; do
STACK_DIR="environments/test/$STACK"
echo "Initializing TEST $STACK backend..."
tofu -chdir="$STACK_DIR" init \
-reconfigure \
-input=false \
-lockfile=readonly \
-no-color
echo "Reading TEST $STACK state..."
RESOURCES="$(tofu -chdir="$STACK_DIR" state list)"
if [ -z "$RESOURCES" ]; then
echo "ERROR: No managed resources found in TEST $STACK state."
exit 1
fi
RESOURCE_COUNT="$(printf '%s\n' "$RESOURCES" | wc -l)"
echo "TEST $STACK: $RESOURCE_COUNT managed resources found."
done
echo "TEST remote state access verified."
# Remove temporary credentials even when verification fails.
- name: Clean up Kubernetes credentials
if: always()
Expand Down