...
1all: build
2.PHONY: all
3
4update: update-codegen-crds
5
6RUNTIME ?= podman
7RUNTIME_IMAGE_NAME ?= registry.ci.openshift.org/openshift/release:rhel-8-release-golang-1.20-openshift-4.14
8
9EXCLUDE_DIRS := _output/ dependencymagnet/ hack/ third_party/ tls/ tools/ vendor/ tests/
10GO_PACKAGES :=$(addsuffix ...,$(addprefix ./,$(filter-out $(EXCLUDE_DIRS), $(wildcard */))))
11
12.PHONY: test-unit
13test-unit:
14 go test -v $(GO_PACKAGES)
15
16##################################################################################
17#
18# BEGIN: Update codegen-crds. Defaults to generating updates for all API packages.
19# To run a subset of packages:
20# - Filter by group with make update-codegen-crds-<group>
21# E.g. make update-codegen-crds-machine
22# - Set API_GROUP_VERSIONS to a space separated list of <group>/<version>.
23# E.g. API_GROUP_VERSIONS="apps/v1 build/v1" make update-codegen-crds.
24# FeatureSet generation is controlled at the group level by the
25# .codegen.yaml file.
26#
27##################################################################################
28
29# Ensure update-scripts are run before crd-gen so updates to Godoc are included in CRDs.
30.PHONY: update-codegen-crds
31update-codegen-crds: update-scripts
32 hack/update-codegen-crds.sh
33
34#####################
35#
36# END: Update Codegen
37#
38#####################
39
40.PHONY: verify-scripts
41verify-scripts:
42 bash -x hack/verify-deepcopy.sh
43 bash -x hack/verify-openapi.sh
44 bash -x hack/verify-protobuf.sh
45 bash -x hack/verify-swagger-docs.sh
46 hack/verify-crds.sh
47 bash -x hack/verify-types.sh
48 bash -x hack/verify-compatibility.sh
49 bash -x hack/verify-integration-tests.sh
50 bash -x hack/verify-group-versions.sh
51
52.PHONY: verify
53verify: verify-scripts verify-codegen-crds
54
55.PHONY: verify-codegen-crds
56verify-codegen-crds:
57 bash -x hack/verify-codegen-crds.sh
58
59.PHONY: verify-%
60verify-%:
61 make $*
62 git diff --exit-code
63
64################################################################################################
65#
66# BEGIN: Update scripts. Defaults to generating updates for all API packages.
67# Set API_GROUP_VERSIONS to a space separated list of <group>/<version> to limit
68# the scope of the updates. Eg API_GROUP_VERSIONS="apps/v1 build/v1" make update-scripts.
69# Note: Protobuf generation is handled separately, see hack/lib/init.sh.
70#
71################################################################################################
72
73.PHONY: update-scripts
74update-scripts: update-compatibility update-openapi update-deepcopy update-protobuf update-swagger-docs tests-vendor
75
76.PHONY: update-compatibility
77update-compatibility:
78 hack/update-compatibility.sh
79
80.PHONY: update-openapi
81update-openapi:
82 hack/update-openapi.sh
83
84.PHONY: update-deepcopy
85update-deepcopy:
86 hack/update-deepcopy.sh
87
88.PHONY: update-protobuf
89update-protobuf:
90 hack/update-protobuf.sh
91
92.PHONY: update-swagger-docs
93update-swagger-docs:
94 hack/update-swagger-docs.sh
95
96#####################
97#
98# END: Update scripts
99#
100#####################
101
102deps:
103 go mod tidy
104 go mod vendor
105 go mod verify
106
107verify-with-container:
108 $(RUNTIME) run -ti --rm -v $(PWD):/go/src/github.com/openshift/api:z -w /go/src/github.com/openshift/api $(RUNTIME_IMAGE_NAME) make verify
109
110generate-with-container:
111 $(RUNTIME) run -ti --rm -v $(PWD):/go/src/github.com/openshift/api:z -w /go/src/github.com/openshift/api $(RUNTIME_IMAGE_NAME) make update
112
113.PHONY: integration
114integration:
115 make -C tests integration
116
117tests-vendor:
118 make -C tests vendor
View as plain text