-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
54 lines (40 loc) · 2.04 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
all: build
.PHONY: all manifests
# Include the library makefile
include $(addprefix ./vendor/github.com/openshift/build-machinery-go/make/, \
golang.mk \
targets/openshift/images.mk \
targets/openshift/codegen.mk \
targets/openshift/deps.mk \
targets/openshift/crd-schema-gen.mk \
)
# Exclude e2e tests from unit testing
GO_TEST_PACKAGES :=./pkg/... ./cmd/...
GO_BUILD_FLAGS :=-tags strictfipsruntime
CI_IMAGE_REGISTRY ?=registry.ci.openshift.org
CODEGEN_OUTPUT_PACKAGE :=github.com/openshift/run-once-duration-override-operator/pkg/generated
CODEGEN_API_PACKAGE :=github.com/openshift/run-once-duration-override-operator/pkg/apis
CODEGEN_GROUPS_VERSION :=runoncedurationoverride:v1
CODEGEN_GO_HEADER_FILE := boilerplate.go.txt
# build image for ci
$(call build-image,runoncedurationoverride-operator,$(CI_IMAGE_REGISTRY)/ocp/4.14:run-once-duration-override-operator,./images/ci/Dockerfile,.)
$(call verify-golang-versions,Dockerfile.rhel7)
test-e2e: GO_TEST_PACKAGES :=./test/e2e
# the e2e imports pkg/cmd which has a data race in the transport library with the library-go init code
test-e2e: GO_TEST_FLAGS :=-v -timeout=3h
test-e2e: test-unit
.PHONY: test-e2e
regen-crd:
go build -o _output/tools/bin/controller-gen ./vendor/sigs.k8s.io/controller-tools/cmd/controller-gen
cp manifests/stable/runoncedurationoverride.crd.yaml manifests/stable/operator.openshift.io_runoncedurationoverrides.yaml
./_output/tools/bin/controller-gen crd paths=./pkg/apis/runoncedurationoverride/v1/... schemapatch:manifests=./manifests/stable
mv manifests/stable/operator.openshift.io_runoncedurationoverrides.yaml manifests/stable/runoncedurationoverride.crd.yaml
generate: update-codegen-crds generate-clients
.PHONY: generate
generate-clients:
bash ./vendor/k8s.io/code-generator/generate-groups.sh all github.com/openshift/run-once-duration-override-operator/pkg/generated github.com/openshift/run-once-duration-override-operator/pkg/apis runoncedurationoverride:v1
.PHONY: generate-clients
clean:
$(RM) -rf ./run-once-duration-override-operator
$(RM) -rf ./_output
.PHONY: clean