Implement app deployment improvements
This commit is contained in:
32
tools/check-tools.sh
Executable file
32
tools/check-tools.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
missing=0
|
||||
|
||||
check_required() {
|
||||
local cmd="$1"
|
||||
if command -v "$cmd" >/dev/null 2>&1; then
|
||||
echo "ok: $cmd"
|
||||
else
|
||||
echo "ERROR: missing required tool: $cmd" >&2
|
||||
missing=1
|
||||
fi
|
||||
}
|
||||
|
||||
check_required kubectl
|
||||
check_required helm
|
||||
check_required sops
|
||||
check_required python3
|
||||
|
||||
if command -v kubectl >/dev/null 2>&1; then
|
||||
if kubectl cnpg --help >/dev/null 2>&1; then
|
||||
echo "ok: kubectl cnpg"
|
||||
else
|
||||
echo "WARN: kubectl cnpg plugin is missing; install with: kubectl krew install cnpg" >&2
|
||||
if ! kubectl krew version >/dev/null 2>&1; then
|
||||
echo "WARN: kubectl krew is missing; install krew before using kubectl krew install cnpg" >&2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
exit "$missing"
|
||||
Reference in New Issue
Block a user