Skip to content

Commit

Permalink
Merge pull request #221 from danielvegamyhre/genfix
Browse files Browse the repository at this point in the history
Automatically move generated client-go files to repo root
  • Loading branch information
k8s-ci-robot authored Jul 5, 2023
2 parents b69dd6a + 90685f7 commit 218c73a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,24 @@ set -o pipefail
cd "$(dirname "${0}")"
GO_CMD=${1:-go}
CODEGEN_PKG=${2:-../bin}
REPO_ROOT="$(git rev-parse --show-toplevel)"

echo "GOPATH=$GOPATH"

bash "${CODEGEN_PKG}/generate-groups.sh" \
"all" \
sigs.k8s.io/jobset/client-go \
sigs.k8s.io/jobset/api \
jobset:v1alpha2 \
--go-header-file ./boilerplate.go.txt

# if client-go files were generated outside of repo root, attempt to move them to the repo root.
CLIENT_GO=$(find $GOPATH -regextype sed -regex ".*jobset.*client-go")
if [ -z "$CLIENT_GO" ]; then
echo "WARNING: generated client-go files were not found."
elif [ "$CLIENT_GO" -ne "$REPO_ROOT/client-go" ]; then
echo "moving generated files from $CLIENT_GO to $REPO_ROOT/client-go"
mv -f $CLIENT_GO $REPO_ROOT
fi


0 comments on commit 218c73a

Please sign in to comment.