Skip to content

Commit

Permalink
chore: new verify-manifests.sh for v2
Browse files Browse the repository at this point in the history
  • Loading branch information
shaneutt committed Jul 28, 2021
1 parent d7d19f9 commit 7f3f440
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jobs:
- name: Run golangci-lint
run: make lint

- name: Verify manifest consistency
run: |
make verify.manifests
image-tests:
runs-on: ubuntu-latest
steps:
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,17 @@ vet:
go vet ./...

.PHONY: lint
lint: verify-tidy
lint: verify.tidy
golangci-lint run ./...

.PHONY: verify-tidy
verify-tidy:
.PHONY: verify.tidy
verify.tidy:
./hack/verify-tidy.sh

.PHONY: verify.manifests
verify.manifests:
./hack/verify-manifests.sh

# ------------------------------------------------------------------------------
# Build - Manifests
# ------------------------------------------------------------------------------
Expand Down
32 changes: 32 additions & 0 deletions hack/verify-manifests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

set -o errexit
set -o nounset
set -o pipefail

SCRIPT_ROOT="$(dirname "${BASH_SOURCE}")/.."

DIFFROOT="${SCRIPT_ROOT}/deploy/single-v2/"

cleanup() {
git checkout "${DIFFROOT}"
}
trap "cleanup" EXIT SIGINT

if ! git status --porcelain --untracked-files=no "$DIFFROOT" ; then
echo "error: please run this script on a clean working copy"
exit 1
fi


"${SCRIPT_ROOT}/hack/deploy/build-single-manifests.sh"

if git diff --quiet "${DIFFROOT}"
then
echo "${DIFFROOT} up to date."
else
echo "${DIFFROOT} is out of date. Please run hack/build-single-manifests.sh"
echo "Diff output:"
git --no-pager diff "${DIFFROOT}"
exit 1
fi

0 comments on commit 7f3f440

Please sign in to comment.