Skip to content

Commit

Permalink
fix: move var definitions before target definitions
Browse files Browse the repository at this point in the history
ensures that the env vars are assigned correctly
  • Loading branch information
JameelB committed Mar 6, 2023
1 parent 447604e commit c7639ef
Showing 1 changed file with 33 additions and 34 deletions.
67 changes: 33 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit c7639ef

Please sign in to comment.