41 lines
900 B
Bash
Executable File
41 lines
900 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -o errexit
|
|
set -o nounset
|
|
set -o pipefail
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
|
|
status=0
|
|
|
|
run_check() {
|
|
local name="$1"
|
|
shift
|
|
|
|
printf '\n== %s ==\n' "$name"
|
|
if [[ ! -x "$1" ]]; then
|
|
printf 'WARNING: %s check is missing or not executable: %s\n' "$name" "$1"
|
|
return 0
|
|
fi
|
|
|
|
if "$@"; then
|
|
printf 'OK: %s completed\n' "$name"
|
|
else
|
|
printf 'CRITICAL: %s failed\n' "$name"
|
|
status=1
|
|
fi
|
|
}
|
|
|
|
run_check "Bash" "$ROOT_DIR/scripts/check-bash.sh"
|
|
run_check "Ansible" "$ROOT_DIR/scripts/check-ansible.sh"
|
|
run_check "Python" "$ROOT_DIR/scripts/check-python.sh"
|
|
run_check "Docs" "$ROOT_DIR/scripts/check-docs.sh"
|
|
|
|
printf '\n== Repository summary ==\n'
|
|
if ((status == 0)); then
|
|
printf 'OK: repository validation completed with no critical failures\n'
|
|
else
|
|
printf 'CRITICAL: one or more validation checks failed\n'
|
|
fi
|
|
|
|
exit "$status"
|