File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,39 @@ jobs:
161
161
162
162
echo "π All required logs are present in S3"
163
163
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
+
164
197
# Destroy Infrastructure
165
198
- name : Destroy Infrastructure
166
199
if : always()
You canβt perform that action at this time.
0 commit comments