mirror of
https://github.com/hanzo-ml/kuberay.git
synced 2026-10-30 19:48:47 +00:00
* Update go modules to include code-generator * Add scripts to generate clients * Clean up code-generator dependency Signed-off-by: Jiaxin Shan <[email protected]> * Update codegen scripts and make required api changes 1. Add update-codegen.sh and verify-codegen.sh 2. Add required changes to register.go and doc.go and //+genclient tag in raycluster_types.go Signed-off-by: Jiaxin Shan <[email protected]> Co-authored-by: Jiaxin Shan <[email protected]>
35 lines
689 B
Bash
35 lines
689 B
Bash
#!/bin/bash
|
|
|
|
set -o errexit
|
|
set -o nounset
|
|
set -o pipefail
|
|
|
|
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
|
|
|
DIFFROOT="${SCRIPT_ROOT}/pkg"
|
|
TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/pkg"
|
|
_tmp="${SCRIPT_ROOT}/_tmp"
|
|
|
|
cleanup() {
|
|
rm -rf "${_tmp}"
|
|
}
|
|
trap "cleanup" EXIT SIGINT
|
|
|
|
cleanup
|
|
|
|
mkdir -p "${TMP_DIFFROOT}"
|
|
cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}"
|
|
|
|
"${SCRIPT_ROOT}/hack/update-codegen.sh"
|
|
echo "diffing ${DIFFROOT} against freshly generated codegen"
|
|
ret=0
|
|
diff -Naupr "${DIFFROOT}" "${TMP_DIFFROOT}" || ret=$?
|
|
cp -a "${TMP_DIFFROOT}"/* "${DIFFROOT}"
|
|
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
|