Skip to content

Commit 46ab1c4

Browse files
committed
testing print logs
1 parent dcb3cbc commit 46ab1c4

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

β€Ž.github/workflows/deploy.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,39 @@ jobs:
161161
162162
echo "πŸŽ‰ All required logs are present in S3"
163163
164+
# Print Logs from Verifier EC2
165+
- name: Print Logs from Verifier EC2
166+
run: |
167+
echo "πŸ“„ Fetching logs from /mylogs/${STAGE} on verifier EC2"
168+
169+
# Retry SSH if EC2 not yet ready
170+
for attempt in {1..5}; do
171+
ssh -o StrictHostKeyChecking=no ubuntu@${VERIFIER_IP} "echo 'βœ… SSH to verifier successful for log fetch'" && break
172+
echo "⏳ Verifier not ready for log fetch, retrying SSH (attempt $attempt)..."
173+
sleep 15
174+
done
175+
176+
# Print system log
177+
ssh -o StrictHostKeyChecking=no ubuntu@${VERIFIER_IP} \
178+
"if [ -f /mylogs/${STAGE}/system/cloud-init.log ]; then
179+
echo 'πŸ“„ ====== system/cloud-init.log ======'
180+
cat /mylogs/${STAGE}/system/cloud-init.log | tail -n 20
181+
else
182+
echo '❌ system/cloud-init.log not found'
183+
fi"
184+
185+
# Print app log
186+
ssh -o StrictHostKeyChecking=no ubuntu@${VERIFIER_IP} \
187+
"if [ -f /mylogs/${STAGE}/app/my-app.log ]; then
188+
echo 'πŸ“„ ====== app/my-app.log ======'
189+
cat /mylogs/${STAGE}/app/my-app.log | tail -n 20
190+
else
191+
echo '❌ app/my-app.log not found'
192+
fi"
193+
194+
echo "βœ… Printed last 20 lines of logs from verifier EC2"
195+
196+
164197
# Destroy Infrastructure
165198
- name: Destroy Infrastructure
166199
if: always()

0 commit comments

Comments
Β (0)