22 lines
713 B
YAML
22 lines
713 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..."
|
|
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
|
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
|
|
- |
|
|
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
|