(refactor): declaring some env vars

This commit is contained in:
bumpsoo 2025-04-21 15:22:59 +00:00
parent f15965991d
commit f4a3b87d4f

View file

@ -3,15 +3,15 @@ RUN_OPTION=\
-v ${HOME}/.ssh:/home/$(shell id -un)/.ssh \ -v ${HOME}/.ssh:/home/$(shell id -un)/.ssh \
-v ${PWD}:/workspace -v ${PWD}:/workspace
ifdef HOST ENV_VARS := GROQ_API_KEY OLLAMA_API_BASE OLLAMA_API_KEY
RUN_OPTION += \
--network host
endif
ifdef GROQ_API_KEY define CHECK_AND_APPEND
RUN_OPTION += \ ifneq ($($(1)),)
-e GROQ_API_KEY=${GROQ_API_KEY} RUN_OPTION += -e $(1)=$($(1))
endif endif
endef
$(foreach VAR,$(ENV_VARS),$(eval $(call CHECK_AND_APPEND,$(VAR))))
BUILD_OPTION=\ BUILD_OPTION=\
--build-arg USERNAME=$(shell id -un) \ --build-arg USERNAME=$(shell id -un) \