From 5e3d696194efb392039ea54e622d0e8754917535 Mon Sep 17 00:00:00 2001 From: Jan Baraniewski Date: Sun, 12 May 2024 00:09:32 +0200 Subject: [PATCH] More logs in codegen script --- hack/code-gen.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hack/code-gen.sh b/hack/code-gen.sh index 7c33584..ecc22cb 100755 --- a/hack/code-gen.sh +++ b/hack/code-gen.sh @@ -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"