forked from vllm-project/aibrix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify-codegen.sh
More file actions
executable file
·42 lines (33 loc) · 1.03 KB
/
Copy pathverify-codegen.sh
File metadata and controls
executable file
·42 lines (33 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# This shell is used to auto generate some useful tools for k8s, such as clientset, lister, informer and so on.
# We don't use this tool to generate deepcopy because kubebuilder (controller-tools) has coverred that part.
set -o errexit
set -o nounset
set -o pipefail
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
DIFFROOT="${SCRIPT_ROOT}/pkg/client"
TMP_DIFFROOT="$(mktemp -d -t "$(basename "$0").XXXXXX")"
cleanup() {
rm -rf "${TMP_DIFFROOT}"
}
trap "cleanup" EXIT SIGINT
cleanup
mkdir -p "${TMP_DIFFROOT}"
cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}"
# Ensure we can execute.
chmod +x ${SCRIPT_ROOT}/hack/update-codegen.sh
"${SCRIPT_ROOT}/hack/update-codegen.sh"
echo "diffing ${DIFFROOT} against freshly generated codegen"
ret=0
diff -Naupr "${DIFFROOT}" "${TMP_DIFFROOT}" || ret=$?
if [[ $ret -eq 0 ]]; then
echo "${DIFFROOT} up to date."
else
echo "${DIFFROOT} is out of date. Please run hack/update-codegen.sh"
exit 1
fi
# smoke test
echo "Smoke testing by compiling..."
pushd "${SCRIPT_ROOT}"
go build "${DIFFROOT}/..."
popd