istio
/
Makefile.core.mk
528 строк · 22.1 Кб
1## Copyright Istio Authors
2##
3## Licensed under the Apache License, Version 2.0 (the "License");
4## you may not use this file except in compliance with the License.
5## You may obtain a copy of the License at
6##
7## http://www.apache.org/licenses/LICENSE-2.0
8##
9## Unless required by applicable law or agreed to in writing, software
10## distributed under the License is distributed on an "AS IS" BASIS,
11## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12## See the License for the specific language governing permissions and
13## limitations under the License.
14
15# Our build tools, post jammy, breaks old versions of docker.
16# These old versions are surprisingly common, so build in a check here
17define warning18Docker version is too old, please upgrade to a newer version.
19endef
20ifneq ($(findstring google,$(HOSTNAME)),)21warning+=Googlers: go/installdocker\#the-version-of-docker-thats-installed-is-old-eg-112622endif
23# The old docker issue manifests as not being able to run *any* binary. So we can test
24# by trying to run a trivial program and ensuring it actually ran. If not, emit our warning.
25# Note: we cannot do anything like $(shell docker version) to check, since that would also fail.
26CAN_RUN := $(shell echo "can I run echo")27ifeq ($(CAN_RUN),)28$(error $(warning))29endif
30
31#-----------------------------------------------------------------------------
32# Global Variables
33#-----------------------------------------------------------------------------
34ISTIO_GO := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))35export ISTIO_GO36SHELL := /bin/bash -o pipefail37
38# Version can be defined:
39# (1) in a $VERSION shell variable, which takes precedence; or
40# (2) in the VERSION file, in which we will append "-dev" to it
41ifeq ($(VERSION),)42VERSION_FROM_FILE := $(shell cat VERSION)43ifeq ($(VERSION_FROM_FILE),)44$(error VERSION not detected. Make sure it's stored in the VERSION file or defined in VERSION variable)45endif
46VERSION := $(VERSION_FROM_FILE)-dev47endif
48
49export VERSION50
51# Base version of Istio image to use
52BASE_VERSION ?= master-2024-03-28T19-01-2253ISTIO_BASE_REGISTRY ?= gcr.io/istio-release54
55export GO111MODULE ?= on56export GOPROXY ?= https://proxy.golang.org57export GOSUMDB ?= sum.golang.org58
59# If GOPATH is not set by the env, set it to a sane value
60GOPATH ?= $(shell cd ${ISTIO_GO}/../../..; pwd)61export GOPATH62
63# If GOPATH is made up of several paths, use the first one for our targets in this Makefile
64GO_TOP := $(shell echo ${GOPATH} | cut -d ':' -f1)65export GO_TOP66
67GO ?= go68
69GOARCH_LOCAL := $(TARGET_ARCH)70GOOS_LOCAL := $(TARGET_OS)71
72#-----------------------------------------------------------------------------
73# Output control
74#-----------------------------------------------------------------------------
75# Invoke make VERBOSE=1 to enable echoing of the command being executed
76export VERBOSE ?= 077# Place the variable Q in front of a command to control echoing of the command being executed.
78Q = $(if $(filter 1,$VERBOSE),,@)79# Use the variable H to add a header (equivalent to =>) to informational output
80H = $(shell printf "\033[34;1m=>\033[0m")81
82ifeq ($(origin DEBUG), undefined)83BUILDTYPE_DIR:=release84else ifeq ($(DEBUG),0)85BUILDTYPE_DIR:=release86else
87BUILDTYPE_DIR:=debug88export GCFLAGS:=all=-N -l89$(info $(H) Build with debugger information)90endif
91
92# Optional file including user-specific settings (HUB, TAG, etc)
93-include .istiorc.mk94
95# Environment for tests, the directory containing istio and deps binaries.
96# Typically same as GOPATH/bin, so tests work seamlessly with IDEs.
97
98export ISTIO_BIN=$(GOBIN)99
100# If we are running in the Linux build container on non Linux hosts, we add the
101# linux binaries to the build dependencies, BUILD_DEPS, which can be added to other targets
102# that would need the Linux binaries (ex. tests).
103BUILD_DEPS:=104ifeq ($(IN_BUILD_CONTAINER),1)105ifneq ($(GOOS_LOCAL),"linux")106BUILD_DEPS += build-linux107endif108endif
109
110export ARTIFACTS ?= $(TARGET_OUT)111export JUNIT_OUT ?= $(ARTIFACTS)/junit.xml112export REPO_ROOT := $(shell git rev-parse --show-toplevel)113
114# Make directories needed by the build system
115$(shell mkdir -p $(TARGET_OUT_LINUX))116$(shell mkdir -p $(TARGET_OUT_LINUX)/logs)117$(shell mkdir -p $(dir $(JUNIT_OUT)))118
119# Need separate target for init:
120$(TARGET_OUT):121@mkdir -p $@122
123# If the hub is not explicitly set, use default to istio.
124HUB ?=istio125ifeq ($(HUB),)126$(error "HUB cannot be empty")127endif
128
129# For dockerx builds, allow HUBS which is a space separated list of hubs. Default to HUB.
130HUBS ?= $(HUB)131
132# If tag not explicitly set in users' .istiorc.mk or command line, default to the git sha.
133TAG ?= $(shell git rev-parse --verify HEAD)134ifeq ($(TAG),)135$(error "TAG cannot be empty")136endif
137
138VARIANT :=139ifeq ($(VARIANT),)140TAG_VARIANT:=${TAG}141else
142TAG_VARIANT:=${TAG}-${VARIANT}143endif
144
145PULL_POLICY ?= IfNotPresent146ifeq ($(TAG),latest)147PULL_POLICY = Always148endif
149ifeq ($(PULL_POLICY),)150$(error "PULL_POLICY cannot be empty")151endif
152
153PROW_ARTIFACTS_BASE ?= https://gcsweb.istio.io/gcs/istio-prow154
155include tools/proto/proto.mk156
157.PHONY: default158default: init build test159
160.PHONY: init161# Downloads envoy, based on the SHA defined in the base pilot Dockerfile
162init: $(TARGET_OUT)/istio_is_init init-ztunnel-rs163@mkdir -p ${TARGET_OUT}/logs164@mkdir -p ${TARGET_OUT}/release165
166# I tried to make this dependent on what I thought was the appropriate
167# lock file, but it caused the rule for that file to get run (which
168# seems to be about obtaining a new version of the 3rd party libraries).
169$(TARGET_OUT)/istio_is_init: bin/init.sh istio.deps | $(TARGET_OUT)170@# Add a retry, as occasionally we see transient connection failures to GCS171@# Like `curl: (56) OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104`172TARGET_OUT=$(TARGET_OUT) ISTIO_BIN=$(ISTIO_BIN) GOOS_LOCAL=$(GOOS_LOCAL) bin/retry.sh SSL_ERROR_SYSCALL bin/init.sh173touch $(TARGET_OUT)/istio_is_init174
175.PHONY: init-ztunnel-rs176init-ztunnel-rs:177TARGET_OUT=$(TARGET_OUT) bin/build_ztunnel.sh178
179# Pull dependencies such as envoy
180depend: init | $(TARGET_OUT)181
182DIRS_TO_CLEAN := $(TARGET_OUT)183DIRS_TO_CLEAN += $(TARGET_OUT_LINUX)184
185$(OUTPUT_DIRS):186@mkdir -p $@187
188.PHONY: ${GEN_CERT}189GEN_CERT := ${ISTIO_BIN}/generate_cert190${GEN_CERT}:191GOOS=$(GOOS_LOCAL) && GOARCH=$(GOARCH_LOCAL) && common/scripts/gobuild.sh $@ ./security/tools/generate_cert192
193#-----------------------------------------------------------------------------
194# Target: precommit
195#-----------------------------------------------------------------------------
196.PHONY: precommit format lint197
198# Target run by the pre-commit script, to automate formatting and lint
199# If pre-commit script is not used, please run this manually.
200precommit: format lint201
202format: fmt ## Auto formats all code. This should be run before sending a PR.203
204fmt: format-go format-python tidy-go205
206ifeq ($(DEBUG),1)207# gobuild script uses custom linker flag to set the variables.
208RELEASE_LDFLAGS=''209else
210RELEASE_LDFLAGS='-extldflags -static -s -w'211endif
212
213# List of all binaries to build
214# We split the binaries into "agent" binaries and standard ones. This corresponds to build "agent".
215# This allows conditional compilation to avoid pulling in costly dependencies to the agent, such as XDS and k8s.
216AGENT_BINARIES:=./pilot/cmd/pilot-agent217STANDARD_BINARIES:=./istioctl/cmd/istioctl \218./pilot/cmd/pilot-discovery \
219./pkg/test/echo/cmd/client \
220./pkg/test/echo/cmd/server \
221./samples/extauthz/cmd/extauthz \
222./operator/cmd/operator
223
224# These are binaries that require Linux to build, and should
225# be skipped on other platforms. Notably this includes the current Linux-only Istio CNI plugin
226LINUX_AGENT_BINARIES:=./cni/cmd/istio-cni \227./cni/cmd/install-cni \
228$(AGENT_BINARIES)229
230BINARIES:=$(STANDARD_BINARIES) $(AGENT_BINARIES) $(LINUX_AGENT_BINARIES)231
232# List of binaries that have their size tested
233RELEASE_SIZE_TEST_BINARIES:=pilot-discovery pilot-agent istioctl envoy ztunnel client server234
235# agent: enables agent-specific files. Usually this is used to trim dependencies where they would be hard to trim through standard refactoring
236# disable_pgv: disables protoc-gen-validation. This is not used buts adds many MB to Envoy protos
237# not set vtprotobuf: this adds some performance improvement, but at a binary cost increase that is not worth it for the agent
238AGENT_TAGS=agent,disable_pgv239# disable_pgv: disables protoc-gen-validation. This is not used buts adds many MB to Envoy protos
240# vtprotobuf: enables optimized protobuf marshalling. Disabled until https://github.com/istio/istio/issues/49790 lands
241STANDARD_TAGS=disable_pgv242
243.PHONY: build244build: depend ## Builds all go binaries.245GOOS=$(GOOS_LOCAL) GOARCH=$(GOARCH_LOCAL) LDFLAGS=$(RELEASE_LDFLAGS) common/scripts/gobuild.sh $(TARGET_OUT)/ -tags=$(STANDARD_TAGS) $(STANDARD_BINARIES)246GOOS=$(GOOS_LOCAL) GOARCH=$(GOARCH_LOCAL) LDFLAGS=$(RELEASE_LDFLAGS) common/scripts/gobuild.sh $(TARGET_OUT)/ -tags=$(AGENT_TAGS) $(AGENT_BINARIES)247
248# The build-linux target is responsible for building binaries used within containers.
249# This target should be expanded upon as we add more Linux architectures: i.e. build-arm64.
250# Then a new build target can be created such as build-container-bin that builds these
251# various platform images.
252.PHONY: build-linux253build-linux: depend254GOOS=linux GOARCH=$(GOARCH_LOCAL) LDFLAGS=$(RELEASE_LDFLAGS) common/scripts/gobuild.sh $(TARGET_OUT_LINUX)/ -tags=$(STANDARD_TAGS) $(STANDARD_BINARIES)255GOOS=linux GOARCH=$(GOARCH_LOCAL) LDFLAGS=$(RELEASE_LDFLAGS) common/scripts/gobuild.sh $(TARGET_OUT_LINUX)/ -tags=$(AGENT_TAGS) $(LINUX_AGENT_BINARIES)256
257# Create targets for TARGET_OUT_LINUX/binary
258# There are two use cases here:
259# * Building all docker images (generally in CI). In this case we want to build everything at once, so they share work
260# * Building a single docker image (generally during dev). In this case we just want to build the single binary alone
261BUILD_ALL ?= true262define build-linux263.PHONY: $(TARGET_OUT_LINUX)/$(shell basename $(1))264ifeq ($(BUILD_ALL),true)265$(TARGET_OUT_LINUX)/$(shell basename $(1)): build-linux266@:267else
268$(TARGET_OUT_LINUX)/$(shell basename $(1)): $(TARGET_OUT_LINUX)269GOOS=linux GOARCH=$(GOARCH_LOCAL) LDFLAGS=$(RELEASE_LDFLAGS) common/scripts/gobuild.sh $(TARGET_OUT_LINUX)/ -tags=$(2) $(1)270endif
271endef
272
273$(foreach bin,$(STANDARD_BINARIES),$(eval $(call build-linux,$(bin),$(STANDARD_TAGS))))274$(foreach bin,$(LINUX_AGENT_BINARIES),$(eval $(call build-linux,$(bin),$(AGENT_TAGS))))275
276# Create helper targets for each binary, like "pilot-discovery"
277# As an optimization, these still build everything
278$(foreach bin,$(BINARIES),$(shell basename $(bin))): build279ifneq ($(TARGET_OUT_LINUX),$(LOCAL_OUT))280# if we are on linux already, then this rule is handled by build-linux above, which handles BUILD_ALL variable
281$(foreach bin,$(BINARIES),${LOCAL_OUT}/$(shell basename $(bin))): build282endif
283
284MARKDOWN_LINT_ALLOWLIST=localhost:8080,storage.googleapis.com/istio-artifacts/pilot/,http://ratings.default.svc.cluster.local:9080/ratings285
286lint-helm-global:287find manifests -name 'Chart.yaml' -print0 | ${XARGS} -L 1 dirname | xargs -r helm lint288
289lint: lint-python lint-copyright-banner lint-scripts lint-go lint-dockerfiles lint-markdown lint-yaml lint-licenses lint-helm-global check-agent-deps ## Runs all linters.290@bin/check_samples.sh291@testlinter292@envvarlinter istioctl pilot security293
294.PHONY: check-agent-deps295check-agent-deps:296@go list -f '{{ join .Deps "\n" }}' \297./security/pkg/nodeagent/caclient/... \
298./security/pkg/nodeagent/plugin/... \
299./security/pkg/nodeagent/cache/... \
300./pkg/bootstrap/... \
301./pkg/envoy/... |\302(! grep -P 'k8s.io/api/|k8s.io/apiextensions-apiserver|k8s.io/client-go|sigs.k8s.io/gateway-api|cel|antlr|go-control-plane/envoy/extensions/filters')303
304go-gen:305@mkdir -p /tmp/bin306@PATH="${PATH}":/tmp/bin go generate ./...307
308refresh-goldens:309@REFRESH_GOLDEN=true go test ${GOBUILDFLAGS} ./operator/... \310./pkg/bootstrap/... \
311./pkg/kube/inject/... \
312./pilot/pkg/security/authz/builder/... \
313./cni/pkg/plugin/...
314
315update-golden: refresh-goldens316
317# Keep dummy target since some build pipelines depend on this
318gen-charts:319@echo "This target is no longer required and will be removed in the future"320
321gen-addons:322manifests/addons/gen.sh
323
324gen: \325mod-download-go \
326go-gen \
327mirror-licenses \
328format \
329update-crds \
330proto \
331copy-templates \
332gen-addons \
333update-golden ## Update all generated code.334
335gen-check: gen check-clean-repo336
337CHARTS = gateway default ztunnel istio-operator base "gateways/istio-ingress" "gateways/istio-egress" "istio-control/istio-discovery" istiod-remote istio-cni338copy-templates:339rm manifests/charts/istiod-remote/templates/*
340rm manifests/charts/gateways/istio-egress/templates/*
341
342# gateway charts343cp -r manifests/charts/gateways/istio-ingress/templates/* manifests/charts/gateways/istio-egress/templates
344find ./manifests/charts/gateways/istio-egress/templates -type f -exec sed -i -e 's/ingress/egress/g' {} \;345find ./manifests/charts/gateways/istio-egress/templates -type f -exec sed -i -e 's/Ingress/Egress/g' {} \;346
347# external istiod remote cluster charts348cp manifests/charts/base/templates/services.yaml manifests/charts/istiod-remote/templates
349cp manifests/charts/base/templates/endpoints.yaml manifests/charts/istiod-remote/templates
350cp manifests/charts/base/templates/reader-serviceaccount.yaml manifests/charts/istiod-remote/templates
351cp manifests/charts/istio-control/istio-discovery/templates/mutatingwebhook.yaml manifests/charts/istiod-remote/templates
352cp manifests/charts/istio-control/istio-discovery/templates/reader-clusterrole.yaml manifests/charts/istiod-remote/templates
353cp manifests/charts/istio-control/istio-discovery/templates/reader-clusterrolebinding.yaml manifests/charts/istiod-remote/templates
354
355# external istiod config cluster charts356cp manifests/charts/istio-control/istio-discovery/files/injection-template.yaml manifests/charts/istiod-remote/files
357cp manifests/charts/istio-control/istio-discovery/files/gateway-injection-template.yaml manifests/charts/istiod-remote/files
358cp manifests/charts/istio-control/istio-discovery/templates/istiod-injector-configmap.yaml manifests/charts/istiod-remote/templates
359cp manifests/charts/istio-control/istio-discovery/templates/configmap.yaml manifests/charts/istiod-remote/templates
360cp manifests/charts/istio-control/istio-discovery/templates/_helpers.tpl manifests/charts/istiod-remote/templates
361sed -e '1 i {{- if .Values.global.configCluster }}' -e '$$ a {{- end }}' manifests/charts/base/crds/crd-all.gen.yaml > manifests/charts/istiod-remote/templates/crd-all.gen.yaml362sed -e '1 i {{- if .Values.global.configCluster }}' -e '$$ a {{- end }}' manifests/charts/base/templates/default.yaml > manifests/charts/istiod-remote/templates/default.yaml363sed -e '1 i {{- if .Values.global.configCluster }}' -e '$$ a {{- end }}' manifests/charts/istio-control/istio-discovery/templates/validatingwebhookconfiguration.yaml > manifests/charts/istiod-remote/templates/validatingwebhookconfiguration.yaml364sed -e '1 i {{- if .Values.global.configCluster }}' -e '$$ a {{- end }}' manifests/charts/istio-control/istio-discovery/templates/serviceaccount.yaml > manifests/charts/istiod-remote/templates/serviceaccount.yaml365sed -e '1 i {{- if .Values.global.configCluster }}' -e '$$ a {{- end }}' manifests/charts/istio-control/istio-discovery/templates/role.yaml > manifests/charts/istiod-remote/templates/role.yaml366sed -e '1 i {{- if .Values.global.configCluster }}' -e '$$ a {{- end }}' manifests/charts/istio-control/istio-discovery/templates/rolebinding.yaml > manifests/charts/istiod-remote/templates/rolebinding.yaml367sed -e '1 i {{- if .Values.global.configCluster }}' -e '$$ a {{- end }}' manifests/charts/istio-control/istio-discovery/templates/clusterrole.yaml > manifests/charts/istiod-remote/templates/clusterrole.yaml368sed -e '1 i {{- if .Values.global.configCluster }}' -e '$$ a {{- end }}' manifests/charts/istio-control/istio-discovery/templates/clusterrolebinding.yaml > manifests/charts/istiod-remote/templates/clusterrolebinding.yaml369
370# copy istio-discovery values, but apply some local customizations371cp manifests/charts/istio-control/istio-discovery/values.yaml manifests/charts/istiod-remote/
372yq -i '.defaults.telemetry.enabled=false | .defaults.global.externalIstiod=true | .defaults.global.omitSidecarInjectorConfigMap=true | .defaults.pilot.configMap=false' manifests/charts/istiod-remote/values.yaml373for chart in $(CHARTS) ; do \374for profile in manifests/helm-profiles/*.yaml ; do \375cp $$profile manifests/charts/$$chart/files/profile-$$(basename $$profile) ; \376done; \377cp manifests/zzz_profile.yaml manifests/charts/$$chart/templates ; \378done
379
380#-----------------------------------------------------------------------------
381# Target: go build
382#-----------------------------------------------------------------------------
383
384# Non-static istioctl targets. These are typically a build artifact.
385${TARGET_OUT}/release/istioctl-linux-amd64:386GOOS=linux GOARCH=amd64 LDFLAGS=$(RELEASE_LDFLAGS) common/scripts/gobuild.sh $@ ./istioctl/cmd/istioctl387${TARGET_OUT}/release/istioctl-linux-armv7:388GOOS=linux GOARCH=arm GOARM=7 LDFLAGS=$(RELEASE_LDFLAGS) common/scripts/gobuild.sh $@ ./istioctl/cmd/istioctl389${TARGET_OUT}/release/istioctl-linux-arm64:390GOOS=linux GOARCH=arm64 LDFLAGS=$(RELEASE_LDFLAGS) common/scripts/gobuild.sh $@ ./istioctl/cmd/istioctl391${TARGET_OUT}/release/istioctl-osx:392GOOS=darwin GOARCH=amd64 LDFLAGS=$(RELEASE_LDFLAGS) common/scripts/gobuild.sh $@ ./istioctl/cmd/istioctl393${TARGET_OUT}/release/istioctl-osx-arm64:394GOOS=darwin GOARCH=arm64 LDFLAGS=$(RELEASE_LDFLAGS) common/scripts/gobuild.sh $@ ./istioctl/cmd/istioctl395${TARGET_OUT}/release/istioctl-win.exe:396GOOS=windows LDFLAGS=$(RELEASE_LDFLAGS) common/scripts/gobuild.sh $@ ./istioctl/cmd/istioctl397
398# generate the istioctl completion files
399${TARGET_OUT}/release/istioctl.bash: ${LOCAL_OUT}/istioctl400${LOCAL_OUT}/istioctl completion bash > ${TARGET_OUT}/release/istioctl.bash401
402${TARGET_OUT}/release/_istioctl: ${LOCAL_OUT}/istioctl403${LOCAL_OUT}/istioctl completion zsh > ${TARGET_OUT}/release/_istioctl404
405.PHONY: binaries-test406binaries-test:407go test ${GOBUILDFLAGS} ./tests/binary/... -v --base-dir ${TARGET_OUT} --binaries="$(RELEASE_SIZE_TEST_BINARIES)"408
409# istioctl-all makes all of the non-static istioctl executables for each supported OS
410.PHONY: istioctl-all411istioctl-all: ${TARGET_OUT}/release/istioctl-linux-amd64 ${TARGET_OUT}/release/istioctl-linux-armv7 ${TARGET_OUT}/release/istioctl-linux-arm64 \412${TARGET_OUT}/release/istioctl-osx \413${TARGET_OUT}/release/istioctl-osx-arm64 \414${TARGET_OUT}/release/istioctl-win.exe415
416.PHONY: istioctl.completion417istioctl.completion: ${TARGET_OUT}/release/istioctl.bash ${TARGET_OUT}/release/_istioctl418
419# istioctl-install builds then installs istioctl into $GOPATH/BIN
420# Used for debugging istioctl during dev work
421.PHONY: istioctl-install-container422istioctl-install-container: istioctl423
424#-----------------------------------------------------------------------------
425# Target: test
426#-----------------------------------------------------------------------------
427
428.PHONY: test429
430# This target sets JUNIT_REPORT to the location of the go-junit-report binary.
431# This binary is provided in the build container. If it is not found, the build
432# container is not being used, so ask the user to install go-junit-report.
433JUNIT_REPORT := $(shell which go-junit-report 2> /dev/null || echo "${ISTIO_BIN}/go-junit-report")434
435${ISTIO_BIN}/go-junit-report:436@echo "go-junit-report was not found in the build environment."437@echo "Please install go-junit-report (ex. go install github.com/jstemmer/go-junit-report@latest)"438@exit 1439
440# This is just an alias for racetest now
441test: racetest ## Runs all unit tests442
443# For now, keep a minimal subset. This can be expanded in the future.
444BENCH_TARGETS ?= ./pilot/...445
446PKG ?= ./...447.PHONY: racetest448racetest: $(JUNIT_REPORT)449go test ${GOBUILDFLAGS} ${T} -race $(PKG) 2>&1 | tee >($(JUNIT_REPORT) > $(JUNIT_OUT))450
451.PHONY: benchtest452benchtest: $(JUNIT_REPORT) ## Runs all benchmarks453prow/benchtest.sh run $(BENCH_TARGETS)454prow/benchtest.sh compare
455
456report-benchtest:457prow/benchtest.sh report
458
459#-----------------------------------------------------------------------------
460# Target: clean
461#-----------------------------------------------------------------------------
462.PHONY: clean463
464clean: ## Cleans all the intermediate files and folders previously generated.465rm -rf $(DIRS_TO_CLEAN)466
467#-----------------------------------------------------------------------------
468# Target: docker
469#-----------------------------------------------------------------------------
470.PHONY: push471
472# for now docker is limited to Linux compiles - why ?
473include tools/istio-docker.mk474
475push: docker.push ## Build and push docker images to registry defined by $HUB and $TAG476
477#-----------------------------------------------------------------------------
478# Target: environment and tools
479#-----------------------------------------------------------------------------
480.PHONY: show.env show.goenv481
482show.env: ; $(info $(H) environment variables...)483$(Q) printenv484
485show.goenv: ; $(info $(H) go environment...)486$(Q) $(GO) version487$(Q) $(GO) env488
489# show makefile variables. Usage: make show.<variable-name>
490show.%: ; $(info $* $(H) $($*))491$(Q) true492
493#-----------------------------------------------------------------------------
494# Target: custom resource definitions
495#-----------------------------------------------------------------------------
496
497update-crds:498bin/update_crds.sh
499
500#-----------------------------------------------------------------------------
501# Target: artifacts and distribution
502#-----------------------------------------------------------------------------
503# deb, rpm, etc packages
504include tools/packaging/packaging.mk505
506#-----------------------------------------------------------------------------
507# Target: integration tests
508#-----------------------------------------------------------------------------
509include tests/integration/tests.mk510
511#-----------------------------------------------------------------------------
512# Target: bookinfo sample
513#-----------------------------------------------------------------------------
514
515export BOOKINFO_VERSION ?= 1.18.0516
517.PHONY: bookinfo.build bookinfo.push518
519bookinfo.build:520@prow/buildx-create521@BOOKINFO_TAG=${BOOKINFO_VERSION} BOOKINFO_HUB=${HUB} samples/bookinfo/src/build-services.sh522
523bookinfo.push: MULTI_ARCH=true524bookinfo.push:525@prow/buildx-create526@BOOKINFO_TAG=${BOOKINFO_VERSION} BOOKINFO_HUB=${HUB} samples/bookinfo/src/build-services.sh --push527
528include common/Makefile.common.mk529