Skip to content

Commit

Permalink
ci: DRY print debug
Browse files Browse the repository at this point in the history
  • Loading branch information
kd7lxl committed Sep 1, 2023
1 parent ac4e6db commit b271c90
Showing 1 changed file with 19 additions and 32 deletions.
51 changes: 19 additions & 32 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@ jobs:
env:
GOPATH: ${{ github.workspace }}
KONK_NAMESPACE: baz
PRINT_DEBUG: |
set +x
while read cmd
do
echo "::group::$cmd"
$cmd
echo "::endgroup::"
done <<< "git diff
helm list --all-namespaces
kubectl describe po,ing,certificate,clusterissuer,issuer,konk,konkservice -A
kubectl get po,rs,svc,ep,certificate,clusterissuer,issuer,ingress,secrets,configmap -A
kubectl logs -l app.kubernetes.io/name=etcd -n $KONK_NAMESPACE
kubectl logs -l app.kubernetes.io/component=apiserver -n $KONK_NAMESPACE
kubectl logs -l app.kubernetes.io/name=konk-operator
kubectl logs -l component=controller,app.kubernetes.io/name=example-apiserver
kubectl logs -l component=apiserver,app.kubernetes.io/name=example-apiserver -c example-apiserver
kubectl logs -l app.kubernetes.io/component=controller -n ingress-nginx"
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down Expand Up @@ -153,22 +170,7 @@ jobs:
done
- name: Print debug
if: ${{ always() }}
run: |
set +x
while read cmd
do
echo "::group::$cmd"
$cmd
echo "::endgroup::"
done <<< "git diff
helm list --all-namespaces
kubectl describe po,ing,certificate,clusterissuer,issuer,konk,konkservice -A
kubectl get po,rs,svc,ep,certificate,clusterissuer,issuer,ingress,secrets,configmap -A
kubectl logs -l app.kubernetes.io/component=apiservice -n $KONK_NAMESPACE
kubectl logs -l app.kubernetes.io/name=konk-operator
kubectl logs -l component=controller,app.kubernetes.io/name=example-apiserver
kubectl logs -l component=apiserver,app.kubernetes.io/name=example-apiserver -c example-apiserver
kubectl logs -l app.kubernetes.io/component=controller -n ingress-nginx"
run: bash -c "$PRINT_DEBUG"
- name: Test delete
timeout-minutes: 3
run: |
Expand All @@ -177,22 +179,7 @@ jobs:
[ -z "$(helm list --all-namespaces --filter '^runner-.*konk(-service)?$' | tee /dev/stderr | grep konk)" ]
- name: Print debug
if: ${{ always() }}
run: |
set +x
while read cmd
do
echo "::group::$cmd"
$cmd
echo "::endgroup::"
done <<< "git diff
helm list --all-namespaces
kubectl describe po,ing,certificate,clusterissuer,issuer,konk,konkservice -A
kubectl get po,rs,svc,ep,certificate,clusterissuer,issuer,ingress,secrets,configmap -A
kubectl logs -l app.kubernetes.io/component=apiserver -n $KONK_NAMESPACE
kubectl logs -l app.kubernetes.io/name=konk-operator
kubectl logs -l component=controller,app.kubernetes.io/name=example-apiserver
kubectl logs -l component=apiserver,app.kubernetes.io/name=example-apiserver -c example-apiserver
kubectl logs -l app.kubernetes.io/component=controller -n ingress-nginx"
run: bash -c "$PRINT_DEBUG"
readme:
runs-on: ubuntu-latest
timeout-minutes: 2
Expand Down

0 comments on commit b271c90

Please sign in to comment.