Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hack scripts to test urls, update add-runbook #12

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nvtkaszpir
Copy link
Contributor

No description provided.

@netlify
Copy link

netlify bot commented Feb 18, 2022

✔️ Deploy Preview for distracted-northcutt-e0bccc ready!

🔨 Explore the source changes: 6862dc7

🔍 Inspect the deploy log: https://app.netlify.com/sites/distracted-northcutt-e0bccc/deploys/620fef66c1b07f00080ac4b5

😎 Browse the preview: https://deploy-preview-12--distracted-northcutt-e0bccc.netlify.app

Comment on lines +1 to +27
#!/usr/bin/env bash
# check urls via trying to connect to hugo server on localhost:1313

rm -rf kps
git clone --depth 1 https://github.com/prometheus-community/helm-charts/ kps

URL_PATHS=$(grep -R "runbook_url:" kps/charts/kube-prometheus-stack | grep .yaml | awk '{print $5}' | tr -d "}" | sort | uniq)

ENDPOINT=${ENDPOINT:-"http://localhost:1313/runbooks"}

exit_code=0
echo "Checking runbook urls... please wait"

for runbook in $URL_PATHS; do
if ! curl --output /dev/null --silent --head --fail "${ENDPOINT}${runbook}"; then
rule_file=$(grep -n -R "$runbook" kps/charts/kube-prometheus-stack | awk '{print $1}')
echo -e "Missing ${runbook} \n\t $EDITOR $rule_file"
exit_code=1
fi
done

if [ $exit_code == 0 ]; then
echo "Great Success, no issues found!"
else
echo "Oh no, errors!"
fi
exit $exit_code
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using mdox for this in kube-prometheus and prometheus-operator. I don't see any reason we shouldn't be using it here too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants