1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-16 09:16:38 +00:00
prometheus-operator/contrib/kube-prometheus/test.sh
2018-05-18 11:00:11 +02:00

32 lines
717 B
Bash
Executable file

#!/usr/bin/env bash
set -e
# only exit with zero if all commands of the pipeline exit successfully
set -o pipefail
for i in examples/jsonnet-snippets/*.jsonnet; do
[ -f "$i" ] || break
echo "Testing: ${i}"
echo ""
snippet="local kp = $(<${i});
$(<examples/jsonnet-build-snippet/build-snippet.jsonnet)"
echo "${snippet}" > "test.jsonnet"
echo "\`\`\`"
echo "${snippet}"
echo "\`\`\`"
echo ""
jsonnet -J vendor "test.jsonnet" > /dev/null
rm -rf "test.jsonnet"
done
for i in examples/*.jsonnet; do
[ -f "$i" ] || break
echo "Testing: ${i}"
echo ""
echo "\`\`\`"
echo "$(<${i})"
echo "\`\`\`"
echo ""
jsonnet -J vendor ${i} > /dev/null
done