24 lines
760 B
YAML
24 lines
760 B
YAML
when:
|
|
event:
|
|
- push
|
|
- pull_request
|
|
|
|
steps:
|
|
- name: validate-manifests
|
|
image: alpine:latest
|
|
commands:
|
|
- apk add --no-cache curl bash ca-certificates
|
|
- update-ca-certificates
|
|
- |
|
|
echo "Installing kubectl..."
|
|
KUBECTL_VERSION=$(curl -s https://dl.k8s.io/release/stable.txt | tr -d '\n')
|
|
curl -LO --fail https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl
|
|
chmod +x kubectl
|
|
mv kubectl /usr/local/bin/
|
|
- |
|
|
echo "Validating Kubernetes manifests with kubectl dry-run..."
|
|
for file in $(find . -maxdepth 1 -type f \( -name '*.yaml' -o -name '*.yml' \)); do
|
|
echo "Checking $file"
|
|
kubectl apply --dry-run=client -f "$file"
|
|
done
|