(refactor): declaring some env vars
This commit is contained in:
parent
f15965991d
commit
f4a3b87d4f
1 changed files with 7 additions and 7 deletions
14
Makefile
14
Makefile
|
|
@ -3,15 +3,15 @@ RUN_OPTION=\
|
|||
-v ${HOME}/.ssh:/home/$(shell id -un)/.ssh \
|
||||
-v ${PWD}:/workspace
|
||||
|
||||
ifdef HOST
|
||||
RUN_OPTION += \
|
||||
--network host
|
||||
endif
|
||||
ENV_VARS := GROQ_API_KEY OLLAMA_API_BASE OLLAMA_API_KEY
|
||||
|
||||
ifdef GROQ_API_KEY
|
||||
RUN_OPTION += \
|
||||
-e GROQ_API_KEY=${GROQ_API_KEY}
|
||||
define CHECK_AND_APPEND
|
||||
ifneq ($($(1)),)
|
||||
RUN_OPTION += -e $(1)=$($(1))
|
||||
endif
|
||||
endef
|
||||
|
||||
$(foreach VAR,$(ENV_VARS),$(eval $(call CHECK_AND_APPEND,$(VAR))))
|
||||
|
||||
BUILD_OPTION=\
|
||||
--build-arg USERNAME=$(shell id -un) \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue