Skip to content

Commit e028075

Browse files
committed
feat: run full generation pipeline from controller repos via ack-generate
Replace shell scripts (build-controller.sh, build-controller-release.sh) with a Go-native pipeline that runs from within the controller repo. The `ack-generate controller` command now handles APIs, deepcopy, CRDs, RBAC, formatting, and boilerplate in a single invocation. Templates and boilerplate files are embedded via go:embed, enabling `go install` without a local code-generator checkout.
1 parent e2c061d commit e028075

24 files changed

Lines changed: 1298 additions & 958 deletions

Makefile

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ GO_LDFLAGS=-ldflags "-X $(IMPORT_PATH)/pkg/version.Version=$(VERSION) \
1818
# aws-sdk-go/private/model/api package is gated behind a build tag "codegen"...
1919
GO_CMD_FLAGS=-tags codegen
2020

21-
.PHONY: all build-ack-generate test \
22-
build-controller build-controller-image \
21+
.PHONY: all build-ack-generate build-controller test \
22+
build-controller-image \
2323
local-build-controller-image lint-shell \
2424
check-crd-compatibility
2525

@@ -30,12 +30,18 @@ build-ack-generate: ## Build ack-generate binary
3030
@go build ${GO_CMD_FLAGS} ${GO_LDFLAGS} -o bin/ack-generate cmd/ack-generate/main.go
3131
@echo "ok."
3232

33-
build-controller: build-ack-generate ## Generate controller code for SERVICE
34-
@./scripts/install-controller-gen.sh
35-
@echo "==== building $(AWS_SERVICE)-controller ===="
36-
@./scripts/build-controller.sh $(AWS_SERVICE)
37-
@echo "==== building $(AWS_SERVICE)-controller release artifacts ===="
38-
@./scripts/build-controller-release.sh $(AWS_SERVICE)
33+
CONTROLLER_PATH ?= ../$(AWS_SERVICE)-controller
34+
RELEASE_VERSION ?= $(shell cd $(CONTROLLER_PATH) && git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0-non-release-version")
35+
36+
ACK_GENERATE_OLM ?= false
37+
OLM_CONFIG_PATH ?= $(CONTROLLER_PATH)/olm/olmconfig.yaml
38+
39+
build-controller: build-ack-generate ## Generate a service controller (SERVICE=s3)
40+
@$(CURDIR)/bin/ack-generate controller $(AWS_SERVICE) -o $(CONTROLLER_PATH)
41+
@$(CURDIR)/bin/ack-generate release $(AWS_SERVICE) $(RELEASE_VERSION) -o $(CONTROLLER_PATH)
42+
ifeq ($(ACK_GENERATE_OLM),true)
43+
@$(CURDIR)/bin/ack-generate olm $(AWS_SERVICE) $(RELEASE_VERSION) -o $(CONTROLLER_PATH) --olm-config $(OLM_CONFIG_PATH)
44+
endif
3945

4046
build-controller-image: export LOCAL_MODULES = false
4147
build-controller-image: ## Build container image for SERVICE

cmd/ack-generate/command/apis.go

Lines changed: 0 additions & 147 deletions
This file was deleted.

0 commit comments

Comments
 (0)