Skip to content

Commit b4e1327

Browse files
Merge pull request #115 from element-hq/gaelg/ci-enhance-error-logs
CI: Enhance error logs
2 parents b5301bc + 4a3b6c3 commit b4e1327

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/pytest.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,18 @@ jobs:
5353
5454
- name: Export logs
5555
if: ${{ failure() }}
56+
shell: bash
5657
run: |
5758
kind export logs --name ess-helm ./ess-helm-logs
5859
kind export kubeconfig --name ess-helm
5960
ns=$(kubectl --context kind-ess-helm get ns -l app.kubernetes.io/managed-by=pytest -o jsonpath='{.items[].metadata.name}')
60-
kubectl --context kind-ess-helm get deployments -o yaml -n $ns > ./ess-helm-logs/deployments.txt
61-
kubectl --context kind-ess-helm get statefulsets -o yaml -n $ns > ./ess-helm-logs/statefulsets.txt
62-
kubectl --context kind-ess-helm get pods -o yaml -n $ns > ./ess-helm-logs/pods.txt
63-
kubectl --context kind-ess-helm get secrets -o yaml -n $ns > ./ess-helm-logs/secrets.txt
64-
kubectl --context kind-ess-helm get configmaps -o yaml -n $ns > ./ess-helm-logs/configmaps.txt
61+
resources=("pods" "deployments" "statefulsets" "services" "configmaps" "secrets" "ingresses" "persistentvolumes" "persistentvolumeclaims")
62+
for i in "${resources[@]}"; do
63+
kubectl --context kind-ess-helm get $i -n $ns > ./ess-helm-logs/$i.txt
64+
echo "----" >> ./ess-helm-logs/$i.txt
65+
kubectl --context kind-ess-helm get $i -o yaml -n $ns >> ./ess-helm-logs/$i.txt
66+
done
67+
kubectl --context kind-ess-helm get events --sort-by=.metadata.creationTimestamp -n $ns > ./ess-helm-logs/events.txt
6568
kind delete cluster --name ess-helm
6669
6770
- name: Upload logs

0 commit comments

Comments
 (0)