Add global options.

This commit is contained in:
fewtarius 2023-06-22 11:34:53 +00:00
parent 4096838466
commit cab907cff9
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A
2 changed files with 8 additions and 3 deletions

View file

@ -74,8 +74,8 @@ docker-%: DOCKER_IMAGE := "justenoughlinuxos/jelos-build:latest"
# Anytime this directory changes, you must run `make clean` similarly to moving the distribution directory
docker-%: DOCKER_WORK_DIR := $(shell if [ -n "${DOCKER_WORK_DIR}" ]; then echo ${DOCKER_WORK_DIR}; else echo "$$(pwd)" ; fi)
# DEVELOPER_SETTINGS is a file containing developer speicific settings. This will be mounted into the container if it exists
docker-%: DEVELOPER_SETTINGS := $(shell if [ -f "${HOME}/developer_settings.conf" ]; then echo "-v \"${HOME}/developer_settings.conf:${HOME}/developer_settings.conf\""; else echo ""; fi)
# ${HOME}/.JELOS/options is a global options file containing developer and build settings.
docker-%: GLOBAL_SETTINGS := $(shell if [ -f "${HOME}/.JELOS/options" ]; then echo "-v \"${HOME}/.JELOS/options:${HOME}/.JELOS/options\""; else echo ""; fi)
# LOCAL_SSH_KEYS_FILE is a variable that contains the location of the authorized keys file for development build use. It will be mounted into the container if it exists.
docker-%: LOCAL_SSH_KEYS_FILE := $(shell if [ -n "${LOCAL_SSH_KEYS_FILE}" ]; then echo "-v \"${LOCAL_SSH_KEYS_FILE}:${LOCAL_SSH_KEYS_FILE}\""; else echo ""; fi)
@ -119,5 +119,5 @@ docker-image-pull:
# Wire up docker to call equivalent make files using % to match and $* to pass the value matched by %
docker-%:
BUILD_DIR=$(DOCKER_WORK_DIR) $(DOCKER_CMD) run $(PODMAN_ARGS) $(INTERACTIVE) --init --env-file .env --rm --user $(UID):$(GID) $(DEVELOPER_SETTINGS) $(LOCAL_SSH_KEYS_FILE) -v $(PWD):$(DOCKER_WORK_DIR) -w $(DOCKER_WORK_DIR) $(DOCKER_EXTRA_OPTS) $(DOCKER_IMAGE) $(COMMAND)
BUILD_DIR=$(DOCKER_WORK_DIR) $(DOCKER_CMD) run $(PODMAN_ARGS) $(INTERACTIVE) --init --env-file .env --rm --user $(UID):$(GID) $(GLOBAL_SETTINGS) $(LOCAL_SSH_KEYS_FILE) -v $(PWD):$(DOCKER_WORK_DIR) -w $(DOCKER_WORK_DIR) $(DOCKER_EXTRA_OPTS) $(DOCKER_IMAGE) $(COMMAND)

View file

@ -46,6 +46,11 @@ BUILD_DATE=$(date)
# include helper functions
. config/functions
# read GLOBAL options if available
if [ -f "${HOME}/${DISTRO}/options" ]; then
. "${HOME}/${DISTRO}/options"
fi
# read DISTRO options if available
if [ -f "${DISTRO_DIR}/${DISTRO}/options" ]; then
. "${DISTRO_DIR}/${DISTRO}/options"