Skip to content
Snippets Groups Projects
Commit 7b3f65f9 authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Fetch log only for current branch

parent 81153cea
No related branches found
No related tags found
No related merge requests found
...@@ -166,15 +166,25 @@ delete-example: ...@@ -166,15 +166,25 @@ delete-example:
variables: variables:
GIT_STRATEGY: none # don't need to checkout sources GIT_STRATEGY: none # don't need to checkout sources
LAST_ROWS_COUNT: "200" # you can override it when triggering the job LAST_ROWS_COUNT: "200" # you can override it when triggering the job
CHART_LOCATION: "chart"
script: script:
- kubectl -n ${NAMESPACE} get quota - kubectl -n ${NAMESPACE} get quota
- mkdir logs
- | - |
for POD in $(kubectl -n ${NAMESPACE} get po --output=jsonpath='{.items[*].metadata.name}'); do for POD in $(kubectl -n ${NAMESPACE} get po -l="app.kubernetes.io/instance=${CI_COMMIT_REF_SLUG}-${CHART_LOCATION}" --output=jsonpath='{.items[*].metadata.name}'); do
echo $POD; echo "************************************************************"
kubectl -n ${NAMESPACE} logs $POD --tail ${LAST_ROWS_COUNT} echo "************************************************************"
echo "* ${POD}";
echo "************************************************************"
kubectl -n ${NAMESPACE} logs $POD --tail ${LAST_ROWS_COUNT} > logs/${POD}.log
cat logs/${POD}.log
done done
before_script: - echo "Check Job artifacts to download or Browse log files... See on right panel"
- kubectl delete jobs -l app=kubeclarity-scanner artifacts:
when: always
paths:
- logs
expire_in: 1 month
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment