-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
45 lines (36 loc) · 1.44 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
all: build
.PHONY: all
SOURCE_GIT_TAG ?=$(shell git describe --long --tags --abbrev=7 --match 'v[0-9]*' || echo 'v1.0.0-$(SOURCE_GIT_COMMIT)')
SOURCE_GIT_COMMIT ?=$(shell git rev-parse --short "HEAD^{commit}" 2>/dev/null)
# OS_GIT_VERSION is populated by ART
# If building out of the ART pipeline, fallback to SOURCE_GIT_TAG
ifndef OS_GIT_VERSION
OS_GIT_VERSION = $(SOURCE_GIT_TAG)
endif
# Include the library makefile
include $(addprefix ./vendor/github.com/openshift/build-machinery-go/make/, \
golang.mk \
targets/openshift/images.mk \
targets/openshift/deps.mk \
)
GO_BUILD_FLAGS :=-tags strictfipsruntime
IMAGE_REGISTRY :=registry.ci.openshift.org
# This will call a macro called "build-image" which will generate image specific targets based on the parameters:
# $0 - macro name
# $1 - target name
# $2 - image ref
# $3 - Dockerfile path
# $4 - context directory for image build# It will generate target "image-$(1)" for building the image an binding it as a prerequisite to target "images".
$(call build-image,cli-manager,$(IMAGE_REGISTRY)/ocp/4.19:cli-manager, ./Dockerfile,.)
clean:
$(RM) ./cli-manager
.PHONY: clean
install-krew:
./hack/install-krew.sh
.PHONY: install-krew
GO_TEST_PACKAGES :=./pkg/... ./cmd/...
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: install-krew test-unit
.PHONY: test-e2e