Skip to content

Instantly share code, notes, and snippets.

@dennislapchenko
Last active March 24, 2022 15:32
Show Gist options
  • Save dennislapchenko/2ac3f66e333ea5ff60fb95d47a6be14b to your computer and use it in GitHub Desktop.
Save dennislapchenko/2ac3f66e333ea5ff60fb95d47a6be14b to your computer and use it in GitHub Desktop.
[Renovate logs] Get logs for specific repository
#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