Skip to content

Commit 41d64b2

Browse files
committed
Add make target to generate test-infra prowjobs via CAPI's prowjob-gen
1 parent 4728557 commit 41d64b2

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ YQ := $(TOOLS_BIN_DIR)/yq
7575
KPROMO := $(TOOLS_BIN_DIR)/kpromo
7676
RELEASE_NOTES := $(TOOLS_BIN_DIR)/release-notes
7777
GORELEASER := $(TOOLS_BIN_DIR)/goreleaser
78+
PROWJOB_GEN := $(TOOLS_BIN_DIR)/prowjob-gen
7879

7980
CLUSTERAWSADM_SRCS := $(call rwildcard,.,cmd/clusterawsadm/*.*)
8081

@@ -423,6 +424,14 @@ generate-test-flavors: $(KUSTOMIZE) ## Generate test template flavors
423424
./hack/gen-test-flavors.sh withoutclusterclass
424425
./hack/gen-test-flavors.sh withclusterclass
425426

427+
.PHONY: generate-test-infra-prowjobs
428+
generate-test-infra-prowjobs: $(PROWJOB_GEN) ## Generates the prowjob configurations in test-infra
429+
@if [ -z "${TEST_INFRA_DIR}" ]; then echo "TEST_INFRA_DIR is not set"; exit 1; fi
430+
$(PROWJOB_GEN) \
431+
-config "$(TEST_INFRA_DIR)/config/jobs/kubernetes-sigs/cluster-api-provider-aws/cluster-api-provider-aws-prowjob-gen.yaml" \
432+
-templates-dir "$(TEST_INFRA_DIR)/config/jobs/kubernetes-sigs/cluster-api-provider-aws/templates" \
433+
-output-dir "$(TEST_INFRA_DIR)/config/jobs/kubernetes-sigs/cluster-api-provider-aws"
434+
426435
.PHONY: e2e-image
427436
e2e-image: docker-pull-prerequisites $(TOOLS_BIN_DIR)/start.sh $(TOOLS_BIN_DIR)/restart.sh ## Build an e2e test image
428437
docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) -f Dockerfile --tag="gcr.io/k8s-staging-cluster-api/capa-manager:e2e" .

hack/tools/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ KUSTOMIZE := $(BIN_DIR)/kustomize
106106
$(KUSTOMIZE): $(BIN_DIR) go.mod go.sum # Build kustomize from tools folder.
107107
CGO_ENABLED=0 go build -tags=tools -o $@ sigs.k8s.io/kustomize/kustomize/v5
108108

109+
PROWJOB_GEN := $(BIN_DIR)/prowjob-gen
110+
$(PROWJOB_GEN): $(BIN_DIR) go.mod go.sum
111+
go build -tags=tools -o $@ sigs.k8s.io/cluster-api/hack/tools/prowjob-gen
112+
109113
MDBOOK_SHARE := $(SHARE_DIR)/mdbook$(MDBOOK_ARCHIVE_EXT)
110114
$(MDBOOK_SHARE): ../../versions.mk $(SHARE_DIR)
111115
curl -sL -o $(MDBOOK_SHARE) "https://github.com/rust-lang/mdBook/releases/download/$(MDBOOK_VERSION)/mdBook-$(MDBOOK_VERSION)-x86_64-$(RUST_TARGET)$(MDBOOK_ARCHIVE_EXT)"

hack/tools/tools.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import (
3636
_ "sigs.k8s.io/cluster-api/hack/tools/conversion-verifier"
3737
_ "sigs.k8s.io/cluster-api/hack/tools/mdbook/embed"
3838
_ "sigs.k8s.io/cluster-api/hack/tools/mdbook/releaselink"
39+
_ "sigs.k8s.io/cluster-api/hack/tools/prowjob-gen"
3940
_ "sigs.k8s.io/controller-runtime/tools/setup-envtest"
4041
_ "sigs.k8s.io/controller-tools/cmd/controller-gen"
4142
_ "sigs.k8s.io/kind"

0 commit comments

Comments
 (0)