Skip to content

Commit

Permalink
More logs in codegen script
Browse files Browse the repository at this point in the history
  • Loading branch information
janekbaraniewski committed May 11, 2024
1 parent 25ae240 commit 5e3d696
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hack/code-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,31 @@ printf "Start code-gen script \n"

# Install the required binaries with modules enabled
go install k8s.io/code-generator
chmod +x "$GOPATH"/pkg/mod/k8s.io/code-generator@v0.30.0/kube_codegen.sh

printf "Got all dependencies \n"

# Ensure proper package tags are in place (See: https://pkg.go.dev/k8s.io/code-generator/cmd/deepcopy-gen)
printf "Running code generators...\n"

chmod +x "$GOPATH"/pkg/mod/k8s.io/code-generator@v0.30.0/kube_codegen.sh

# Use generate-groups.sh helper script to run all code generators
"$GOPATH"/pkg/mod/k8s.io/code-generator@v0.30.0/kube_codegen.sh all \
github.com/janekbaraniewski/kubeserial/pkg/generated \
github.com/janekbaraniewski/kubeserial/pkg/apis \
v1alpha1

printf "Finished kube_codegen.sh, updating source files...\n"

# Manual copy might be required if output paths are incorrectly set by the tools, adjust paths as needed
if [[ "${COPY_OR_DIFF}" == "copy" ]]; then
printf "Removing old generated files...\n"
rm -rf ./pkg/generated
printf "Populating with new generated files...\n"
mkdir -p ./pkg/generated
cp -r "$GOPATH/src/github.com/janekbaraniewski/kubeserial/pkg/generated/"* ./pkg/generated/
fi

printf "Final checks...\n"
replace_or_compare "$GOPATH/src/github.com/janekbaraniewski/kubeserial/pkg/generated/" ./pkg/generated/

printf "All generators have completed.\n"

0 comments on commit 5e3d696

Please sign in to comment.