(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 ${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) \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue