diff --git a/Makefile b/Makefile index 8c7ca6e7a..72980a363 100644 --- a/Makefile +++ b/Makefile @@ -70,6 +70,39 @@ CURL ?= curl OC ?= oc OCM ?= ocm +### Environment-sourced variables with defaults +# Can be overriden by setting environment var before running +# Example: +# OCM_ENV=testing make run +# export OCM_ENV=testing; make run +export GOPROXY=https://proxy.golang.org +export GOPRIVATE=gitlab.cee.redhat.com + +ifeq ($(shell uname -s | tr A-Z a-z), darwin) + CONTAINER_IMAGE_BUILD_PLATFORM ?= "--platform linux/amd64" +endif + +# Set the environment to integration by default +ifndef OCM_ENV + OCM_ENV:=integration +endif + +ifndef TEST_SUMMARY_FORMAT + TEST_SUMMARY_FORMAT=short-verbose +endif + +ifndef SERVER_URL + SERVER_URL:=http://localhost:8000 +endif + +ifndef TEST_TIMEOUT + ifeq ($(OCM_ENV), integration) + TEST_TIMEOUT=15m + else + TEST_TIMEOUT=5h + endif +endif + GOLANGCI_LINT ?= $(LOCAL_BIN_PATH)/golangci-lint golangci-lint: ifeq (, $(shell which $(LOCAL_BIN_PATH)/golangci-lint 2> /dev/null)) @@ -159,40 +192,6 @@ openapi/spec/validate: specinstall ${SPECTRAL} lint ../../openapi/kas-fleet-manager.yaml ../../openapi/kas-fleet-manager-private-admin.yaml ;\ } -### Environment-sourced variables with defaults -# Can be overriden by setting environment var before running -# Example: -# OCM_ENV=testing make run -# export OCM_ENV=testing; make run - -ifeq ($(shell uname -s | tr A-Z a-z), darwin) - CONTAINER_IMAGE_BUILD_PLATFORM ?= --platform linux/amd64 -endif - -# Set the environment to development by default -ifndef OCM_ENV - OCM_ENV:=integration -endif - -ifndef TEST_SUMMARY_FORMAT - TEST_SUMMARY_FORMAT=short-verbose -endif - -export GOPROXY=https://proxy.golang.org -export GOPRIVATE=gitlab.cee.redhat.com - -ifndef SERVER_URL - SERVER_URL:=http://localhost:8000 -endif - -ifndef TEST_TIMEOUT - ifeq ($(OCM_ENV), integration) - TEST_TIMEOUT=15m - else - TEST_TIMEOUT=5h - endif -endif - # Prints a list of useful targets. help: @echo "Kafka Service Fleet Manager make targets"