1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00
node-feature-discovery/scripts/test-infra/verify.sh
2021-10-04 09:43:21 +03:00

40 lines
1 KiB
Bash
Executable file

#!/bin/bash -e
# Install deps
gobinpath="$(go env GOPATH)/bin"
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b "$gobinpath" v1.42.1
export PATH=$PATH:$(go env GOPATH)/bin
curl -sfL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash -s -- --version v3.5.2
kubectl="$gobinpath/kubectl"
curl -L https://dl.k8s.io/release/v1.22.1/bin/linux/amd64/kubectl -o "$kubectl"
chmod 755 "$kubectl"
# Run verify steps
make gofmt-verify
make ci-lint
make helm-lint
# Check that repo is clean
if ! git diff --quiet; then
echo "Repository is dirty!"
exit 1
fi
# Check that templates are up-to-date
make templates
if ! git diff --quiet; then
echo "Deployment templates are not up-to-date. Run 'make templates' to update"
exit 1
fi
# Check that the kustomize overlays are buildable
for d in `ls deployment/overlays/* -d`; do
if [ "`basename $d`" = "samples" ]; then
continue
fi
echo "Verifying $d"
kubectl kustomize $d > /dev/null
done