Last active
March 24, 2022 15:32
-
-
Save dennislapchenko/2ac3f66e333ea5ff60fb95d47a6be14b to your computer and use it in GitHub Desktop.
[Renovate logs] Get logs for specific repository
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Usage: renovate_log_grep renovate-job-pod-f43jn my-app | |
renovate_log_grep() { | |
repo_txt="(repository=bidstack/${2:?repo name required as arg 2})" | |
tmp_file=${1:?pod name required as arg 1}.log | |
kubectl logs ${1} > $tmp_file | |
START=$(grep -n "started ${repo_txt}" $tmp_file | cut -f1 -d:) | |
FINISH=$(grep -n "finished ${repo_txt}" $tmp_file | cut -f1 -d:) | |
sed -n "$START, $FINISH p" $tmp_file || echo "repo not found" | |
rm $tmp_file | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment